auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public Boolean aggregateJobDetails(JobDetails jobDetails, AggregationConstants.AGGREGATION_TYPE aggType) { HTable aggTable = aggDailyTable; switch (aggType) { case DAILY: aggTable = aggDailyTable; break; case WEEKLY: aggTable = aggWeeklyTable; break; default: LOG.error("Unknown aggregation type : " + aggType); return false; } try { JobKey jobKey = jobDetails.getJobKey(); AppAggregationKey appAggKey = new AppAggregationKey(jobKey.getCluster(), jobKey.getUserName(), jobKey.getAppId(), getTimestamp(jobKey.getRunId(), aggType)); LOG.info("Aggregating " + aggType + " stats for " + jobKey.toString()); Increment aggIncrement = incrementAppSummary(appAggKey, jobDetails); aggTable.increment(aggIncrement); boolean status = updateMoreAggInfo(aggTable, appAggKey, jobDetails); return status; } catch (Exception e) { LOG.error("Caught exception while attempting to aggregate for " + aggType + " table " + e); e.printStackTrace(); return Boolean.FALSE; } }

Target:
public boolean aggregateJobDetails(JobDetails jobDetails, AggregationConstants.AGGREGATION_TYPE aggType) { HTable aggTable = aggDailyTable; switch (aggType) { case DAILY: aggTable = aggDailyTable; break; case WEEKLY: aggTable = aggWeeklyTable; break; default: LOG.error("Unknown aggregation type : " + aggType); return false; } try { JobKey jobKey = jobDetails.getJobKey(); AppAggregationKey appAggKey = new AppAggregationKey(jobKey.getCluster(), jobKey.getUserName(), jobKey.getAppId(), getTimestamp(jobKey.getRunId(), aggType)); LOG.info("Aggregating " + aggType + " stats for " + jobKey.toString()); Increment aggIncrement = incrementAppSummary(appAggKey, jobDetails); aggTable.increment(aggIncrement); boolean status = updateMoreAggInfo(aggTable, appAggKey, jobDetails); return status; } catch (Exception e) { LOG.error("Caught exception while attempting to aggregate for " + aggType + " table ", e); return false; } }
Source:
public String getTccConfigInstrumentOrigin() { InstGmosCommon inst = (InstGmosCommon) _oe.getInstrument(); switch (_oe.getAoAspect()) { case ngs : return "ngs2gmos"; case lgs : return _oe.getAltairConfig().getMode().equals(AltairParams.Mode.LGS_P1) ? "lgs2gmos_p1" : "lgs2gmos"; default: return ((GmosCommonType.FPUnit) inst.getFPUnit()).isIFU() ? "gmos_ifu" : "gmos"; } }

Target:
public String getTccConfigInstrumentOrigin() { InstGmosCommon inst = (InstGmosCommon) _oe.getInstrument(); switch (_oe.getAoAspect()) { case ngs : return "ngs2gmos"; case lgs : return _oe.adjustInstrumentOriginForLGS_P1("lgs2gmos"); default: return ((GmosCommonType.FPUnit) inst.getFPUnit()).isIFU() ? "gmos_ifu" : "gmos"; } }
Source:
public void beginTree(DetailAST rootAST) { context = new Context(null); }

Target:
public void beginTree(DetailAST rootAST) { context = new Context(null); contextStack.clear(); }
Source:
private void fireChildChangedEvents(final String path, Set<IZkChildListener> childListeners, boolean pathExists) { try { final ZkPathStatRecord pathStatRecord = new ZkPathStatRecord(path); for (final IZkChildListener listener : childListeners) { _eventThread.send(new ZkEventThread.ZkEvent("Children of " + path + " changed sent to " + listener) { @Override public void run() throws Exception { if (!pathStatRecord.pathChecked()) { if (!pathExists) { pathStatRecord.recordPathStat(getStat(path, hasListeners(path) && pathExists), OptionalLong.empty()); } else { pathStatRecord.recordPathStat(getStat(path, true, true), OptionalLong.empty()); } } List<String> children = null; if (pathStatRecord.pathExists()) { try { children = getChildren(path); } catch (ZkNoNodeException e) { LOG.warn("Get children under path: failed.", path, e); } } listener.handleChildChange(path, children); } }); } } catch (Exception e) { LOG.error("Failed to fire child changed event. Unable to getChildren.", e); } }

Target:
private void fireChildChangedEvents(final String path, Set<IZkChildListener> childListeners, boolean pathExists) { try { final ZkPathStatRecord pathStatRecord = new ZkPathStatRecord(path); for (final IZkChildListener listener : childListeners) { _eventThread.send(new ZkEventThread.ZkEvent("Children of " + path + " changed sent to " + listener) { @Override public void run() throws Exception { if (!pathStatRecord.pathChecked()) { Stat stat = null; if (!pathExists || !hasListeners(path)) { stat = getStat(path, false); } else { stat = installWatchOnlyPathExist(path); } pathStatRecord.recordPathStat(stat, OptionalLong.empty()); } List<String> children = null; if (pathStatRecord.pathExists()) { try { children = getChildren(path); } catch (ZkNoNodeException e) { LOG.warn("Get children under path: failed.", path, e); } } listener.handleChildChange(path, children); } }); } } catch (Exception e) { LOG.error("Failed to fire child changed event. Unable to getChildren.", e); } }
Source:
private boolean findAssignments() { try { return assignmentsExport.getAssignmentsInSite(siteId); } catch (TypeException te) { log.error("export-common-cartridge type error outputting assignments" + te); setErrMessage("Error outputting forum attachments: " + te.getMessage()); return false; } catch (PermissionException pe) { log.error("export-common-cartridge permission error outputting assignments" + pe); setErrMessage("Error outputting forum attachments: " + pe.getMessage()); return false; } catch (IdUnusedException ide) { log.error("export-common-cartridge ID unuse error outputting assignments" + ide); setErrMessage("Error outputting forum attachments: " + ide.getMessage()); return false; } catch (ServerOverloadException soe) { log.error("export-common-cartridge server overload error outputting assignments" + soe); setErrMessage("Error outputting selected files: " + soe.getMessage()); return false; } }

Target:
private boolean findAssignments() { return assignmentsExport.getAssignmentsInSite(siteId); }
Source:
public ResponseEntity<Void> beginValidation( @ApiParam(value="Validation parameters") @RequestBody final ValidationRestInput validationInput) { final String uniqueJobId = ValidationRequests.createUniqueValidationJobKey(validationInput.getCodeSystemURI()); final String jobId = ValidationRequests .prepareValidate() .setRuleParameters(ImmutableMap.of( ValidationConfiguration.IS_UNPUBLISHED_ONLY, validationInput.isUnpublishedOnly() )) .setRuleIds(validationInput.getRuleIds()) .build(new CodeSystemURI(validationInput.getCodeSystemURI())) .runAsJobWithRestart(uniqueJobId, String.format("Validating '%s'", validationInput.getCodeSystemURI())) .execute(getBus()) .getSync(1, TimeUnit.MINUTES); return ResponseEntity.created(getResourceLocationURI(jobId)).build(); }

Target:
public ResponseEntity<Void> beginValidation( @ApiParam(value="Validation parameters") @RequestBody final ValidationRestInput validationInput) { final String uniqueJobId = ValidationRequests.createUniqueValidationJobKey(validationInput.getPath()); final String jobId = ValidationRequests .prepareValidate() .setRuleParameters(ImmutableMap.of( ValidationConfiguration.IS_UNPUBLISHED_ONLY, validationInput.isUnpublishedOnly() )) .setRuleIds(validationInput.getRuleIds()) .build(repositoryId, validationInput.getPath()) .runAsJobWithRestart(uniqueJobId, String.format("Validating '%s'", validationInput.getPath())) .execute(getBus()) .getSync(1, TimeUnit.MINUTES); return ResponseEntity.created(getResourceLocationURI(jobId)).build(); }
Source:
private static void setLogStreamLevel(int level) { LogStream.level = 6; }

Target:
private static void setLogStreamLevel(int level) { LogStream.level = level; }
Source:
MediaControllerImplBase(Context context, MediaController instance, SessionToken token, Executor executor, ControllerCallback callback) { mInstance = instance; if (context == null) { throw new IllegalArgumentException("context shouldn't be null"); } if (token == null) { throw new IllegalArgumentException("token shouldn't be null"); } if (callback == null) { throw new IllegalArgumentException("callback shouldn't be null"); } if (executor == null) { throw new IllegalArgumentException("executor shouldn't be null"); } mContext = context; mSequencedFutureManager = new SequencedFutureManager(); mControllerStub = new MediaControllerStub(this, mSequencedFutureManager); mToken = token; mCallback = callback; mCallbackExecutor = executor; mDeathRecipient = new IBinder.DeathRecipient() { @Override public void binderDied() { mInstance.close(); } }; boolean connectCalled; if (mToken.getType() == SessionToken.TYPE_SESSION) { mServiceConnection = null; connectCalled = connectToSession(); } else { mServiceConnection = new SessionServiceConnection(); connectCalled = connectToService(); } if (!connectCalled) { close(); } }

Target:
MediaControllerImplBase(Context context, MediaController instance, SessionToken token, Executor executor, ControllerCallback callback) { mInstance = instance; if (context == null) { throw new IllegalArgumentException("context shouldn't be null"); } if (token == null) { throw new IllegalArgumentException("token shouldn't be null"); } if (callback == null) { throw new IllegalArgumentException("callback shouldn't be null"); } if (executor == null) { throw new IllegalArgumentException("executor shouldn't be null"); } mContext = context; mSequencedFutureManager = new SequencedFutureManager(); mControllerStub = new MediaControllerStub(this, mSequencedFutureManager); mToken = token; mCallback = callback; mCallbackExecutor = executor; mDeathRecipient = new IBinder.DeathRecipient() { @Override public void binderDied() { mInstance.close(); } }; IMediaSession iSession = IMediaSession.Stub.asInterface((IBinder) mToken.getBinder()); if (mToken.getType() == SessionToken.TYPE_SESSION) { mServiceConnection = null; connectToSession(); } else { mServiceConnection = new SessionServiceConnection(); connectToService(); } }
Source:
@Override Bitmap decode(Request data) throws IOException { boolean loadFromLocalCacheOnly = retryCount == 0; Response response = downloader.load(data.uri, loadFromLocalCacheOnly); if (response == null) { return null; } loadedFrom = response.isCached() ? DISK : NETWORK; Bitmap result = response.getBitmap(); if (result != null) { return result; } InputStream is = response.getInputStream(); if (is == null) { return null; } if (loadedFrom == NETWORK) { stats.dispatchDownloadFinished(is.available()); } try { return decodeStream(is, data); } finally { Utils.closeQuietly(is); } }

Target:
@Override Bitmap decode(Request data) throws IOException { boolean loadFromLocalCacheOnly = retryCount == 0; Response response = downloader.load(data.uri, loadFromLocalCacheOnly); if (response == null) { return null; } loadedFrom = response.cached ? DISK : NETWORK; Bitmap result = response.getBitmap(); if (result != null) { return result; } InputStream is = response.getInputStream(); if (is == null) { return null; } if (loadedFrom == NETWORK && response.getContentLength() > 0) { stats.dispatchDownloadFinished(response.getContentLength()); } try { return decodeStream(is, data); } finally { Utils.closeQuietly(is); } }
Source:
public void addValue(String value) { Objects.requireNonNull(value, "'value' cannot be null."); this.value += "," + value; }

Target:
public void addValue(String value) { if (this.value != null) { this.value += "," + value; } else { this.value = value; } }
Source:
public String toString() { return String.join(", ", value); }

Target:
public String toString() { return Arrays.toString(value); }
Source:
protected void runTest(@Nonnull String testName, @Nonnull baksmaliOptions options) throws IOException, RecognitionException { String smaliFile = String.format("%s%s%s.smali", testDir, File.separatorChar, testName); InputStream smaliStream = LambdaTest.class.getClassLoader(). getResourceAsStream(smaliFile); if (smaliStream == null) { Assert.fail("Could not load " + smaliFile); } String source = readFully(smaliStream); BaksmaliTestUtils.assertSmaliCompiledEquals(source, source, options, true); }

Target:
protected void runTest(@Nonnull String testName, @Nonnull baksmaliOptions options) throws IOException, RecognitionException { String inputFilename = getInputFilename(testName); String input = readResourceFully(getInputFilename(testName)); String output; if (getOutputFilename(testName).equals(inputFilename)) { output = input; } else { output = readResourceFully(getOutputFilename(testName)); } BaksmaliTestUtils.assertSmaliCompiledEquals(input, output, options, true); }
Source:
public int compareTo(ImmutableHideData o) { return ComparisonChain.start() .compare(enchantments, o.hideEnchantments().get()) .compare(attributes, o.hideAttributes().get()) .compare(unbreakable, o.hideUnbreakable().get()) .compare(canDestroy, o.hideCanDestroy().get()) .compare(canPlace, o.hideCanPlace().get()) .compare(miscellaneous, o.hideMiscellaneous().get()) .result(); }

Target:
public int compareTo(ImmutableHideData o) { return ComparisonChain.start() .compare(this.enchantments, o.hideEnchantments().get()) .compare(this.attributes, o.hideAttributes().get()) .compare(this.unbreakable, o.hideUnbreakable().get()) .compare(this.canDestroy, o.hideCanDestroy().get()) .compare(this.canPlace, o.hideCanPlace().get()) .compare(this.miscellaneous, o.hideMiscellaneous().get()) .result(); }
Source:
private void buildForm() { generateIds(); boolean virtSupported = ApplicationModeHelper.isModeSupported(ApplicationMode.VirtOnly); boolean glusterSupported = ApplicationModeHelper.isModeSupported(ApplicationMode.GlusterOnly); formBuilder = new FormBuilder(formPanel, 1, 8); formBuilder.setRelativeColumnWidth(0, 3); formBuilder.addFormItem(new FormItem(constants.osVersionHostGeneral(), oS, 0).withAutoPlacement()); formBuilder.addFormItem(new FormItem(constants.kernelVersionHostGeneral(), kernelVersion, 0).withAutoPlacement()); formBuilder.addFormItem(new FormItem(constants.kvmVersionHostGeneral(), kvmVersion, 0, virtSupported).withAutoPlacement()); formBuilder.addFormItem(new FormItem(constants.libvirtVersionHostGeneral(), libvirtVersion, 0, virtSupported).withAutoPlacement()); formBuilder.addFormItem(new FormItem(constants.vdsmVersionHostGeneral(), vdsmVersion, 0).withAutoPlacement()); formBuilder.addFormItem(new FormItem(constants.spiceVersionHostGeneral(), spiceVersion, 0, virtSupported).withAutoPlacement()); formBuilder.addFormItem(new FormItem(constants.glusterVersionHostGeneral(), glusterVersion, 0, glusterSupported).withAutoPlacement()); formBuilder.addFormItem(new FormItem(constants.rhsVersionHostGeneral(), rhsVersion, 0, glusterSupported).withAutoPlacement()); }

Target:
private void buildForm() { generateIds(); boolean virtSupported = ApplicationModeHelper.isModeSupported(ApplicationMode.VirtOnly); boolean glusterSupported = ApplicationModeHelper.isModeSupported(ApplicationMode.GlusterOnly); formBuilder = new FormBuilder(formPanel, 1, 9); formBuilder.setRelativeColumnWidth(0, 3); formBuilder.addFormItem(new FormItem(constants.osVersionHostGeneral(), oS, 0).withAutoPlacement()); formBuilder.addFormItem(new FormItem(constants.kernelVersionHostGeneral(), kernelVersion, 0).withAutoPlacement()); formBuilder.addFormItem(new FormItem(constants.kvmVersionHostGeneral(), kvmVersion, 0, virtSupported).withAutoPlacement()); formBuilder.addFormItem(new FormItem(constants.libvirtVersionHostGeneral(), libvirtVersion, 0, virtSupported).withAutoPlacement()); formBuilder.addFormItem(new FormItem(constants.vdsmVersionHostGeneral(), vdsmVersion, 0).withAutoPlacement()); formBuilder.addFormItem(new FormItem(constants.spiceVersionHostGeneral(), spiceVersion, 0, virtSupported).withAutoPlacement()); formBuilder.addFormItem(new FormItem(constants.glusterVersionHostGeneral(), glusterVersion, 0, glusterSupported).withAutoPlacement()); formBuilder.addFormItem(new FormItem(constants.cephVersionHostGeneral(), librbdVersion, 0, virtSupported).withAutoPlacement()); formBuilder.addFormItem(new FormItem(constants.rhsVersionHostGeneral(), rhsVersion, 0, glusterSupported).withAutoPlacement()); }
Source:
public void testNormalizedUrl() throws IOException { int port = 8000 + new Random().nextInt(1000); HttpServer server = HttpServer.create(new InetSocketAddress(port), 0); server.createContext( "/", new HttpHandler() { @Override public void handle(HttpExchange httpExchange) throws IOException { byte[] response = httpExchange.getRequestURI().toString().getBytes(); httpExchange.sendResponseHeaders(200, response.length); OutputStream os = httpExchange.getResponseBody(); os.write(response); os.close(); } }); server.start(); ApacheHttpTransport transport = new ApacheHttpTransport(); com.google.api.client.http.HttpResponse response = transport .createRequestFactory() .buildGetRequest(new GenericUrl("http://localhost:" + port + "/foo .execute(); assertEquals(200, response.getStatusCode()); assertEquals("/foo }

Target:
public void testNormalizedUrl() throws IOException { HttpServer server = HttpServer.create(new InetSocketAddress(0), 0); server.createContext( "/", new HttpHandler() { @Override public void handle(HttpExchange httpExchange) throws IOException { byte[] response = httpExchange.getRequestURI().toString().getBytes(); httpExchange.sendResponseHeaders(200, response.length); try (OutputStream out = httpExchange.getResponseBody()) { out.write(response); } } }); server.start(); ApacheHttpTransport transport = new ApacheHttpTransport(); GenericUrl testUrl = new GenericUrl("http://localhost/foo testUrl.setPort(server.getAddress().getPort()); com.google.api.client.http.HttpResponse response = transport .createRequestFactory() .buildGetRequest(testUrl) .execute(); assertEquals(200, response.getStatusCode()); assertEquals("/foo }
Source:
private void updateLabelStyle(View notationView, BasicLabelStyle labelStyle) { if (labelStyle != null) { final FontStyle fontStyle = (FontStyle) createOrFindStyle(notationView, NotationPackage.eINSTANCE.getFontStyle()); labelStyle.getLabelFormat().clear(); if (fontStyle.isBold()) { labelStyle.getLabelFormat().add(FontFormat.BOLD_LITERAL); } if (fontStyle.isItalic()) { labelStyle.getLabelFormat().add(FontFormat.ITALIC_LITERAL); } if (fontStyle.isUnderline()) { labelStyle.getLabelFormat().add(FontFormat.UNDERLINE_LITERAL); } if (fontStyle.isStrikeThrough()) { labelStyle.getLabelFormat().add(FontFormat.STRIKE_THROUGH_LITERAL); } labelStyle.setLabelSize(fontStyle.getFontHeight()); } }

Target:
private void updateLabelStyle(View notationView, BasicLabelStyle labelStyle) { if (labelStyle != null) { List<FontFormat> newFontFormats = Lists.newArrayList(); final FontStyle fontStyle = (FontStyle) createOrFindStyle(notationView, NotationPackage.eINSTANCE.getFontStyle()); if (fontStyle.isBold()) { newFontFormats.add(FontFormat.BOLD_LITERAL); } if (fontStyle.isItalic()) { newFontFormats.add(FontFormat.ITALIC_LITERAL); } if (fontStyle.isUnderline()) { newFontFormats.add(FontFormat.UNDERLINE_LITERAL); } if (fontStyle.isStrikeThrough()) { newFontFormats.add(FontFormat.STRIKE_THROUGH_LITERAL); } labelStyle.getLabelFormat().clear(); labelStyle.getLabelFormat().addAll(newFontFormats); labelStyle.setLabelSize(fontStyle.getFontHeight()); } }
Source:
public void add(PhaseResult phaseResult) { validIndexRowCount += phaseResult.validIndexRowCount; expiredIndexRowCount += phaseResult.expiredIndexRowCount; missingIndexRowCount += phaseResult.missingIndexRowCount; invalidIndexRowCount += phaseResult.invalidIndexRowCount; expiredIndexRowCount += phaseResult.mismatchingNumberOfCellsCount; }

Target:
public void add(PhaseResult phaseResult) { validIndexRowCount += phaseResult.validIndexRowCount; expiredIndexRowCount += phaseResult.expiredIndexRowCount; missingIndexRowCount += phaseResult.missingIndexRowCount; invalidIndexRowCount += phaseResult.invalidIndexRowCount; indexHasExtraCellsCount += phaseResult.indexHasExtraCellsCount; indexHasMissingCellsCount += phaseResult.indexHasMissingCellsCount; }
Source:
public int parseArguments(final Parameters params) throws CmdLineException { final String name = params.getParameter(0); if (new File(name).isDirectory()) { setter.addValue(new FileTreeIterator( new File(name), FS.DETECTED, clp.getRepository().getConfig().get(WorkingTreeOptions.KEY))); return 1; } if (new File(name).isFile()) { final DirCache dirc; try { dirc = DirCache.read(new File(name), FS.DETECTED); } catch (IOException e) { throw new CmdLineException(MessageFormat.format(CLIText.get().notAnIndexFile, name), e); } setter.addValue(new DirCacheIterator(dirc)); return 1; } final ObjectId id; try { id = clp.getRepository().resolve(name); } catch (IOException e) { throw new CmdLineException(e.getMessage()); } if (id == null) throw new CmdLineException(MessageFormat.format(CLIText.get().notATree, name)); final CanonicalTreeParser p = new CanonicalTreeParser(); try (final ObjectReader curs = clp.getRepository().newObjectReader()) { p.reset(curs, clp.getRevWalk().parseTree(id)); } catch (MissingObjectException e) { throw new CmdLineException(MessageFormat.format(CLIText.get().notATree, name)); } catch (IncorrectObjectTypeException e) { throw new CmdLineException(MessageFormat.format(CLIText.get().notATree, name)); } catch (IOException e) { throw new CmdLineException(MessageFormat.format(CLIText.get().cannotReadBecause, name, e.getMessage())); } setter.addValue(p); return 1; }

Target:
public int parseArguments(final Parameters params) throws CmdLineException { final String name = params.getParameter(0); if (new File(name).isDirectory()) { setter.addValue(new FileTreeIterator( new File(name), FS.DETECTED, clp.getRepository().getConfig().get(WorkingTreeOptions.KEY))); return 1; } if (new File(name).isFile()) { final DirCache dirc; try { dirc = DirCache.read(new File(name), FS.DETECTED); } catch (IOException e) { throw new CmdLineException(MessageFormat.format(CLIText.get().notAnIndexFile, name), e); } setter.addValue(new DirCacheIterator(dirc)); return 1; } final ObjectId id; try { id = clp.getRepository().resolve(name); } catch (IOException e) { throw new CmdLineException(e.getMessage()); } if (id == null) throw new CmdLineException(MessageFormat.format(CLIText.get().notATree, name)); final CanonicalTreeParser p = new CanonicalTreeParser(); try (ObjectReader curs = clp.getRepository().newObjectReader()) { p.reset(curs, clp.getRevWalk().parseTree(id)); } catch (MissingObjectException e) { throw new CmdLineException(MessageFormat.format(CLIText.get().notATree, name)); } catch (IncorrectObjectTypeException e) { throw new CmdLineException(MessageFormat.format(CLIText.get().notATree, name)); } catch (IOException e) { throw new CmdLineException(MessageFormat.format(CLIText.get().cannotReadBecause, name, e.getMessage())); } setter.addValue(p); return 1; }
Source:
private void addRequiredNamespaces(FeatureTypeInfo[] featureTypeInfos, XSDSchema schema) { final WorkspaceInfo localWorkspace = LocalWorkspace.get(); if (localWorkspace != null) { LocalWorkspace.remove(); } try { if (localWorkspace != null && localWorkspace.isIsolated()) { final Map<String, String> schemaNamespacesMap = schema.getQNamePrefixToNamespaceMap(); final List<NamespaceInfo> catalogNamespaces = catalog.getNamespaces(); for (FeatureTypeInfo featureTypeInfo : featureTypeInfos) { Object mapObject = featureTypeInfo .getFeatureType() .getUserData() .get(Types.DECLARED_NAMESPACES_MAP); if (!(mapObject instanceof Map)) continue; final Map<String, String> featureTypeNamespaces = (Map<String, String>) mapObject; featureTypeNamespaces .entrySet() .forEach( entry -> { final String uri = entry.getValue(); if (schemaNamespacesMap.containsValue(uri)) return; final Optional<NamespaceInfo> nsFromCatalog = catalogNamespaces .stream() .filter( nsi -> Objects.equals( nsi.getURI(), uri)) .findFirst(); final String prefix = nsFromCatalog .map(NamespaceInfo::getPrefix) .orElse(entry.getKey()); schemaNamespacesMap.put(prefix, uri); }); } } else { for (NamespaceInfo nameSpaceinfo : catalog.getNamespaces()) { if (!schema.getQNamePrefixToNamespaceMap() .containsKey(nameSpaceinfo.getPrefix())) { schema.getQNamePrefixToNamespaceMap() .put(nameSpaceinfo.getPrefix(), nameSpaceinfo.getURI()); } } } } catch (IOException e) { logger.log(Level.SEVERE, "Unable to add namespaces", e); throw new UncheckedIOException(e); } finally { LocalWorkspace.set(localWorkspace); } }

Target:
private void addRequiredNamespaces(FeatureTypeInfo[] featureTypeInfos, XSDSchema schema) { final WorkspaceInfo localWorkspace = LocalWorkspace.get(); if (localWorkspace != null) { LocalWorkspace.remove(); } try { final Map<String, String> schemaNamespacesMap = schema.getQNamePrefixToNamespaceMap(); final List<NamespaceInfo> catalogNamespaces = catalog.getNamespaces(); for (FeatureTypeInfo featureTypeInfo : featureTypeInfos) { Object mapObject = featureTypeInfo .getFeatureType() .getUserData() .get(Types.DECLARED_NAMESPACES_MAP); if (!(mapObject instanceof Map)) continue; final Map<String, String> featureTypeNamespaces = (Map<String, String>) mapObject; featureTypeNamespaces .entrySet() .forEach( entry -> { final String uri = entry.getValue(); if (schemaNamespacesMap.containsValue(uri)) return; final Optional<NamespaceInfo> nsFromCatalog = catalogNamespaces .stream() .filter( nsi -> Objects.equals( nsi.getURI(), uri)) .findFirst(); final String prefix = nsFromCatalog .map(NamespaceInfo::getPrefix) .orElse(entry.getKey()); schemaNamespacesMap.put(prefix, uri); }); } if (!schemaNamespacesMap.containsValue(XLINK.NAMESPACE)) { Optional<NamespaceInfo> xlinkNSFromCatalog = catalogNamespaces .stream() .filter(x -> XLINK.NAMESPACE.equals(x.getURI())) .findFirst(); schemaNamespacesMap.put( xlinkNSFromCatalog .map(NamespaceInfo::getPrefix) .orElse(WFSXmlUtils.XLINK_DEFAULT_PREFIX), XLINK.NAMESPACE); } } catch (IOException e) { logger.log(Level.SEVERE, "Unable to add namespaces", e); throw new UncheckedIOException(e); } finally { LocalWorkspace.set(localWorkspace); } }
Source:
public Map<String, Object> getExportProperties() { this.exportProperties.clear(); if (!ObjectUtils.isEmpty(this.properties)) { Map<String, String> target = bindProperties(); BeanExpressionResolver beanExpressionResolver = ((ConfigurableApplicationContext) applicationContext) .getBeanFactory().getBeanExpressionResolver(); BeanExpressionContext expressionContext = new BeanExpressionContext( ((ConfigurableApplicationContext) applicationContext).getBeanFactory(), null); for (Entry<String, String> entry : target.entrySet()) { if (isMatch(entry.getKey(), this.properties, null)) { String stringValue = ObjectUtils.nullSafeToString(entry.getValue()); Object exportedValue = null; if (stringValue != null) { exportedValue = stringValue.startsWith("#{") ? beanExpressionResolver.evaluate( environment.resolvePlaceholders(stringValue), expressionContext) : environment.resolvePlaceholders(stringValue); } this.exportProperties.put(entry.getKey(), exportedValue); } } } return exportProperties; }

Target:
public Map<String, Object> getExportProperties() { if (this.exportProperties == null) { this.exportProperties = buildExportProperties(); } return this.exportProperties; }
Source:
public void setUp() throws SQLException { super.setUp(); if (testType.equals(SQL_ONLY_EXECUTION)) { im = new MockSQLOnlyIndexManager(ds); } else if (testType.equals(MATCHER_EXECUTION)) { im = new MockMatcherIndexManager(ds); } else if (testType.equals(STANDARD_EXECUTION)) { im = new IndexManager(ds); } assertThat(im, is(notNullValue())); db = TestUtils.getDatabaseConnectionToExistingDb(im.getDatabase()); assertThat(db, is(notNullValue())); assertThat(im.getQueue(), is(notNullValue())); String[] metadataTableList = new String[] { IndexManager.INDEX_METADATA_TABLE_NAME }; SQLDatabaseTestUtils.assertTablesExist(TestUtils.getDatabaseConnectionToExistingDb(db), metadataTableList); }

Target:
public void setUp() throws SQLException { super.setUp(); if (testType.equals(SQL_ONLY_EXECUTION)) { im = new MockSQLOnlyIndexManager(ds); } else if (testType.equals(MATCHER_EXECUTION)) { im = new MockMatcherIndexManager(ds); } else if (testType.equals(STANDARD_EXECUTION)) { im = new IndexManager(ds); } assertThat(im, is(notNullValue())); db = TestUtils.getDatabaseConnectionToExistingDb(im.getDatabase()); assertThat(db, is(notNullValue())); assertThat(im.getQueue(), is(notNullValue())); String[] metadataTableList = new String[] { IndexManager.INDEX_METADATA_TABLE_NAME }; SQLDatabaseTestUtils.assertTablesExist(db, metadataTableList); }
Source:
public void registerComponents(Context context, Glide glide, Registry registry) { registry.prepend(String.class, Drawable.class, new ApkImageModelLoaderFactory(context.getPackageManager())); registry.prepend(String.class, String.class, new CloudIconModelFactory(context)); }

Target:
public void registerComponents(Context context, Glide glide, Registry registry) { registry.prepend(String.class, Drawable.class, new ApkImageModelLoaderFactory(context.getPackageManager())); registry.prepend(String.class, Bitmap.class, new CloudIconModelFactory(context)); }
Source:
private static IStatistics<@NonNull BasicSegment> getDescriptiveStatistics(ISeries series) { double[] ySeries = series.getYSeries(); assertNotNull(ySeries); IStatistics<@NonNull BasicSegment> stats = new Statistics<>(s -> s.getLength()); for (double item : ySeries) { stats.update(new BasicSegment(0, (long) (item - 1.0))); } return stats; }

Target:
private static IStatistics<@NonNull Long> getDescriptiveStatistics(ISeries series) { double[] ySeries = series.getYSeries(); assertNotNull(ySeries); IStatistics<@NonNull Long> stats = new Statistics<>(); for (double item : ySeries) { stats.update((long) (item - 1.0)); } return stats; }
Source:
public void testSamplesWhenReadingOne() throws IOException { for (int i = 0; i < SAMPLE_BYTES.length; i++) { input = new ByteArrayObjectDataInput(SAMPLE_BYTES[i], serializationService, DEFAULT_BYTE_ORDER); DataInputNavigableJsonAdapter.UTF8Reader reader = new DataInputNavigableJsonAdapter.UTF8Reader(input); assertReadOne(reader, SAMPLE_BYTES[i]); } }

Target:
public void testSamplesWhenReadingOne() throws IOException { for (byte[] sample : SAMPLE_BYTES) { input = new ByteArrayObjectDataInput(sample, serializationService, DEFAULT_BYTE_ORDER); DataInputNavigableJsonAdapter.UTF8Reader reader = new DataInputNavigableJsonAdapter.UTF8Reader(input); assertReadOne(reader, sample); } }
Source:
private String extractColumn(PColumn column) { String colName = column.getName().getString(); if (column.getFamilyName() != null){ String colFamilyName = column.getFamilyName().getString(); colName = colFamilyName.equals(QueryConstants.DEFAULT_COLUMN_FAMILY)? colName : String.format("\"%s\".\"%s\"", colFamilyName, colName); } boolean isArrayType = column.getDataType().isArrayType(); String type = column.getDataType().getSqlTypeName(); Integer maxLength = column.getMaxLength(); Integer arrSize = column.getArraySize(); Integer scale = column.getScale(); StringBuilder buf = new StringBuilder(colName); buf.append(' '); if (isArrayType) { String arrayPrefix = type.split("\\s+")[0]; buf.append(arrayPrefix); if (maxLength != null) { buf.append('('); buf.append(maxLength); if (scale != null) { buf.append(','); buf.append(scale); } buf.append(')'); } buf.append(' '); buf.append("ARRAY"); if (arrSize != null) { buf.append('['); buf.append(arrSize); buf.append(']'); } } else { buf.append(type); if (maxLength != null) { buf.append('('); buf.append(maxLength); if (scale != null) { buf.append(','); buf.append(scale); } buf.append(')'); } } if (!column.isNullable()) { buf.append(' '); buf.append("NOT NULL"); } return buf.toString(); }

Target:
private String extractColumn(PColumn column) { String colName = column.getName().getString(); if (column.getFamilyName() != null){ String colFamilyName = column.getFamilyName().getString(); colName = colFamilyName.equals(QueryConstants.DEFAULT_COLUMN_FAMILY)? colName : String.format("\"%s\".\"%s\"", colFamilyName, colName); } boolean isArrayType = column.getDataType().isArrayType(); String type = column.getDataType().getSqlTypeName(); Integer maxLength = column.getMaxLength(); Integer arrSize = column.getArraySize(); Integer scale = column.getScale(); StringBuilder buf = new StringBuilder(colName); buf.append(' '); if (isArrayType) { String arrayPrefix = type.split("\\s+")[0]; buf.append(arrayPrefix); appendMaxLengthAndScale(buf, maxLength, scale); buf.append(' '); buf.append("ARRAY"); if (arrSize != null) { buf.append('['); buf.append(arrSize); buf.append(']'); } } else { buf.append(type); appendMaxLengthAndScale(buf, maxLength, scale); } if (!column.isNullable()) { buf.append(' '); buf.append("NOT NULL"); } return buf.toString(); }
Source:
LRESULT WM_MOUSEHOVER (long wParam, long lParam) { System.out.println("hover"); LRESULT result = super.WM_MOUSEHOVER (wParam, lParam); int bits = (int) OS.SendMessage (handle, OS.LVM_GETEXTENDEDLISTVIEWSTYLE, 0, 0); int mask = OS.LVS_EX_ONECLICKACTIVATE | OS.LVS_EX_TRACKSELECT | OS.LVS_EX_TWOCLICKACTIVATE; if ((bits & mask) != 0) return result; return LRESULT.ZERO; }

Target:
LRESULT WM_MOUSEHOVER (long wParam, long lParam) { LRESULT result = super.WM_MOUSEHOVER (wParam, lParam); int bits = (int) OS.SendMessage (handle, OS.LVM_GETEXTENDEDLISTVIEWSTYLE, 0, 0); int mask = OS.LVS_EX_ONECLICKACTIVATE | OS.LVS_EX_TRACKSELECT | OS.LVS_EX_TWOCLICKACTIVATE; if ((bits & mask) != 0) return result; return LRESULT.ZERO; }
Source:
public void shutdown() { if (replicationManager != null) { replicationManager.stop(); } if(clusterManagerAdapter != null) { clusterManagerAdapter.shutdown(); } if (lock != null) { lock.shutdown(); } }

Target:
public void shutdown() { if (replicationManager != null) { replicationManager.stop(); } if (clusterManagerAdapter != null) { clusterManagerAdapter.shutdown(); } if (lockClient != null) { lockClient.shutdown(); } }
Source:
public ExpressionTree COMMON_SCALAR() { return b.<ExpressionTree>nonterminal(PHPLexicalGrammar.COMMON_SCALAR).is( b.firstOf( f.nowdocLiteral(b.token(PHPLexicalGrammar.NOWDOC)), NUMERIC_LITERAL(), STRING_LITERAL(), f.booleanLiteral(b.token(PHPLexicalGrammar.BOOLEAN_LITERAL)), f.nullLiteral(b.token(PHPLexicalGrammar.NULL)), f.magicConstantLiteral(b.firstOf( b.token(PHPLexicalGrammar.CLASS_CONSTANT), b.token(PHPLexicalGrammar.FILE_CONSTANT), b.token(PHPLexicalGrammar.DIR_CONSTANT), b.token(PHPLexicalGrammar.FUNCTION_CONSTANT), b.token(PHPLexicalGrammar.LINE_CONSTANT), b.token(PHPLexicalGrammar.METHOD_CONSTANT), b.token(PHPLexicalGrammar.NAMESPACE_CONSTANT), b.token(PHPLexicalGrammar.TRAIT_CONSTANT))))); }

Target:
public ExpressionTree COMMON_SCALAR() { return b.<ExpressionTree>nonterminal(PHPLexicalGrammar.COMMON_SCALAR).is( b.firstOf( NUMERIC_LITERAL(), STRING_LITERAL(), f.booleanLiteral(b.token(PHPLexicalGrammar.BOOLEAN_LITERAL)), f.nullLiteral(b.token(PHPLexicalGrammar.NULL)), f.magicConstantLiteral(b.firstOf( b.token(PHPLexicalGrammar.CLASS_CONSTANT), b.token(PHPLexicalGrammar.FILE_CONSTANT), b.token(PHPLexicalGrammar.DIR_CONSTANT), b.token(PHPLexicalGrammar.FUNCTION_CONSTANT), b.token(PHPLexicalGrammar.LINE_CONSTANT), b.token(PHPLexicalGrammar.METHOD_CONSTANT), b.token(PHPLexicalGrammar.NAMESPACE_CONSTANT), b.token(PHPLexicalGrammar.TRAIT_CONSTANT))))); }
Source:
public static <T extends IConnection> T getConnectionForExplorerSelection(Class<T> klass) { ISelection selection = getOpenShiftExplorerSelection(); if(selection != null) { if(selection != null && !selection.isEmpty()) { T result = UIUtils.getFirstElement(selection, klass); IViewPart part = getOpenShiftExplorer(); if(result == null && selection instanceof IStructuredSelection && part instanceof CommonNavigator) { Object selected = ((IStructuredSelection)selection).getFirstElement(); IContentProvider provider = ((CommonNavigator) part).getCommonViewer().getContentProvider(); if(provider instanceof ITreeContentProvider) { ITreeContentProvider tree = (ITreeContentProvider)provider; while(selected != null && result == null) { result = UIUtils.adapt(selected, klass); selected = tree.getParent(selected); } } } return result; } } return null; }

Target:
public static <T extends IConnection> T getConnectionForExplorerSelection(Class<T> klass) { ISelection selection = getOpenShiftExplorerSelection(); if (selection != null && !selection.isEmpty()) { T result = UIUtils.getFirstElement(selection, klass); IViewPart part = getOpenShiftExplorer(); if (result == null && selection instanceof IStructuredSelection && part instanceof CommonNavigator) { Object selected = ((IStructuredSelection) selection).getFirstElement(); IContentProvider provider = ((CommonNavigator) part).getCommonViewer().getContentProvider(); if (provider instanceof ITreeContentProvider) { ITreeContentProvider tree = (ITreeContentProvider) provider; while (selected != null && result == null) { result = UIUtils.adapt(selected, klass); selected = tree.getParent(selected); } } } return result; } return null; }
Source:
public void testServiceReplacedWithEmptySet() throws InterruptedException { discoveryClient.addDiscoveredService(APPLE_1_SERVICE); updater.start(); ArgumentCaptor<Multiset> captor = ArgumentCaptor.forClass(Multiset.class); verify(httpServiceBalancer).updateHttpUris(captor.capture()); discoveryClient.remove(APPLE_1_SERVICE.getId()); Thread.sleep(10000); verifyNoMoreInteractions(httpServiceBalancer); assertEqualsIgnoreOrder(captor.getValue(), ImmutableMultiset.of(URI.create("<LINK_0>"))); }

Target:
public void testServiceReplacedWithEmptySet() throws InterruptedException { SerialScheduledExecutorService serialExecutor = new SerialScheduledExecutorService(); updater = new ServiceDescriptorsUpdater(new HttpServiceBalancerListenerAdapter(httpServiceBalancer), "apple", new ServiceSelectorConfig().setPool("pool"), nodeInfo, discoveryClient, serialExecutor); discoveryClient.addDiscoveredService(APPLE_1_SERVICE); updater.start(); ArgumentCaptor<Multiset> captor = ArgumentCaptor.forClass(Multiset.class); verify(httpServiceBalancer).updateHttpUris(captor.capture()); discoveryClient.remove(APPLE_1_SERVICE.getId()); serialExecutor.elapseTime(11, TimeUnit.SECONDS); verifyNoMoreInteractions(httpServiceBalancer); assertEqualsIgnoreOrder(captor.getValue(), ImmutableMultiset.of(URI.create("<LINK_0>"))); }
Source:
public Action<?, ?> configUpdateFailedAction() { return new AbstractStackFailureAction<ClusterCreationState, ClusterCreationEvent>() { @Override protected void doExecute(StackFailureContext context, StackFailureEvent payload, Map<Object, Object> variables) { pillarConfigUpdateService .handleConfigUpdateFailure(context.getStackView(), payload.getException()); sendEvent(context); } @Override protected Selectable createRequest(StackFailureContext context) { return new StackEvent(PillarConfigurationUpdateEvent.PILLAR_CONFIG_UPDATE_FAILURE_HANDLED_EVENT .event(), context.getStackView().getId()); } }; }

Target:
public Action<?, ?> configUpdateFailedAction() { return new AbstractStackFailureAction<ClusterCreationState, ClusterCreationEvent>() { @Override protected void doExecute(StackFailureContext context, StackFailureEvent payload, Map<Object, Object> variables) { LOGGER.warn("Pillar configuration update failed.", payload.getException()); pillarConfigUpdateService .handleConfigUpdateFailure(context.getStackView(), payload.getException()); sendEvent(context); } @Override protected Selectable createRequest(StackFailureContext context) { return new StackEvent(PillarConfigurationUpdateEvent.PILLAR_CONFIG_UPDATE_FAILURE_HANDLED_EVENT .event(), context.getStackView().getId()); } }; }
Source:
protected void testAccessControl() throws Exception { InstructorAttributes instructor1OfCourse1 = typicalBundle.instructors.get("instructor1OfCourse1"); FeedbackSessionAttributes session1InCourse1 = typicalBundle.feedbackSessions.get("session1InCourse1"); loginAsInstructor(instructor1OfCourse1.googleId); ______TS("non-existent feedback session"); String[] nonExistParams = new String[] { Const.ParamsNames.COURSE_ID, session1InCourse1.getCourseId(), Const.ParamsNames.FEEDBACK_SESSION_NAME, "abcRandomSession", }; verifyCannotAccess(nonExistParams); ______TS("inaccessible without ModifySessionPrivilege"); String[] params = new String[] { Const.ParamsNames.COURSE_ID, session1InCourse1.getCourseId(), Const.ParamsNames.FEEDBACK_SESSION_NAME, session1InCourse1.getFeedbackSessionName(), }; verifyInaccessibleWithoutModifySessionPrivilege(params); ______TS("only instructors of the same course can access"); verifyOnlyInstructorsOfTheSameCourseCanAccess(params); }

Target:
protected void testAccessControl() throws Exception { InstructorAttributes instructor1OfCourse1 = typicalBundle.instructors.get("instructor1OfCourse1"); FeedbackSessionAttributes session1InCourse1 = typicalBundle.feedbackSessions.get("session1InCourse1"); loginAsInstructor(instructor1OfCourse1.googleId); ______TS("non-existent course"); String[] nonExistParams = new String[] { Const.ParamsNames.COURSE_ID, "abcRandomCourseId", Const.ParamsNames.FEEDBACK_SESSION_NAME, session1InCourse1.getFeedbackSessionName(), }; verifyCannotAccess(nonExistParams); ______TS("non-existent feedback session"); nonExistParams = new String[] { Const.ParamsNames.COURSE_ID, session1InCourse1.getCourseId(), Const.ParamsNames.FEEDBACK_SESSION_NAME, "abcRandomSession", }; verifyCannotAccess(nonExistParams); ______TS("inaccessible without ModifySessionPrivilege"); String[] params = new String[] { Const.ParamsNames.COURSE_ID, session1InCourse1.getCourseId(), Const.ParamsNames.FEEDBACK_SESSION_NAME, session1InCourse1.getFeedbackSessionName(), }; verifyInaccessibleWithoutModifySessionPrivilege(params); ______TS("only instructors of the same course can access"); verifyOnlyInstructorsOfTheSameCourseCanAccess(params); }
Source:
protected void deleteAsyncQuery() { try { Date cleanupDate = dateUtil.calculateFilterDate(Calendar.DATE, queryCleanupDays); PathElement createdOnPathElement = new PathElement(AsyncQuery.class, Long.class, "createdOn"); FilterExpression fltDeleteExp = new LEPredicate(createdOnPathElement, cleanupDate); Collection<AsyncQuery> asyncQueryList = asyncQueryDao.deleteAsyncQueryAndResultCollection(fltDeleteExp); resultStorageEngine.deleteResultsCollection(asyncQueryList); } catch (Exception e) { log.error("Exception in scheduled cleanup: {}", e); } }

Target:
protected void deleteAsyncQuery() { try { Date cleanupDate = dateUtil.calculateFilterDate(Calendar.DATE, queryCleanupDays); PathElement createdOnPathElement = new PathElement(AsyncQuery.class, Long.class, "createdOn"); FilterExpression fltDeleteExp = new LEPredicate(createdOnPathElement, cleanupDate); asyncQueryDao.deleteAsyncQueryAndResultCollection(fltDeleteExp); } catch (Exception e) { log.error("Exception in scheduled cleanup: {}", e); } }
Source:
protected void initializeArrays(int numCodes) { n = new int[numCodes][InfiniumVcfFields.GENOTYPE_VALUES.values().length]; devR = new float[numCodes][InfiniumVcfFields.GENOTYPE_VALUES.values().length]; meanR = new float[numCodes][InfiniumVcfFields.GENOTYPE_VALUES.values().length]; devTheta = new float[numCodes][InfiniumVcfFields.GENOTYPE_VALUES.values().length]; meanTheta = new float[numCodes][InfiniumVcfFields.GENOTYPE_VALUES.values().length]; totalScore = new float[numCodes]; rsNames = new String[numCodes]; rsNameToIndex = new HashMap<>(); }

Target:
private void initializeArrays(int numCodes) { n = new int[numCodes][InfiniumVcfFields.NUM_GENOTYPE_VALUES]; devR = new float[numCodes][InfiniumVcfFields.NUM_GENOTYPE_VALUES]; meanR = new float[numCodes][InfiniumVcfFields.NUM_GENOTYPE_VALUES]; devTheta = new float[numCodes][InfiniumVcfFields.NUM_GENOTYPE_VALUES]; meanTheta = new float[numCodes][InfiniumVcfFields.NUM_GENOTYPE_VALUES]; totalScore = new float[numCodes]; rsNames = new String[numCodes]; rsNameToIndex = new HashMap<>(); }
Source:
public SinglePassSamProgram makeInstance(final String outbase, final String outext, final File input, final File reference, final Set<MetricAccumulationLevel> metricAccumulationLevel, final File dbSnp, final File intervals) { final CollectRrbsMetrics program = new CollectRrbsMetrics(); program.OUTPUT = new File(outbase + ".rrbc.detail_metrics" + outext); program.SUMMARY_OUTPUT = new File(outbase + ".rrbc.summary_metrics" + outext); program.CHART_OUTPUT = new File(outbase + ".rrbc.pdf"); program.INPUT = input; program.METRIC_ACCUMULATION_LEVEL = metricAccumulationLevel; program.ASSUME_SORTED = false; program.setReferenceSequence(reference); return program; }

Target:
public SinglePassSamProgram makeInstance(final String outbase, final String outext, final File input, final File reference, final Set<MetricAccumulationLevel> metricAccumulationLevel, final File dbSnp, final File intervals) { final CollectRrbsMetrics program = new CollectRrbsMetrics(); program.OUTPUT = new File(outbase + ".rrbs.detail_metrics" + outext); program.SUMMARY_OUTPUT = new File(outbase + ".rrbs.summary_metrics" + outext); program.CHART_OUTPUT = new File(outbase + ".rrbs.pdf"); program.INPUT = input; program.METRIC_ACCUMULATION_LEVEL = metricAccumulationLevel; program.ASSUME_SORTED = false; program.setReferenceSequence(reference); return program; }
Source:
public WMTSGetCapabilitiesResponse(HTTPResponse response, Map<String, Object> hints) throws ServiceException, IOException { super(response); try { Object object; InputStream inputStream = null; try { inputStream = response.getResponseStream(); Parser parser = new Parser(new WMTSConfiguration()); object = parser.parse(new InputSource(inputStream)); } catch (SAXException |ParserConfigurationException e) { throw (ServiceException) new ServiceException("Error while parsing XML.") .initCause(e); } finally { IOUtils.closeQuietly(inputStream); } if (object instanceof ServiceException) { throw (ServiceException) object; } this.capabilities = new WMTSCapabilities( (CapabilitiesType)object); } finally { response.dispose(); } }

Target:
public WMTSGetCapabilitiesResponse(HTTPResponse response, Map<String, Object> hints) throws ServiceException, IOException { super(response); try { Object object; InputStream inputStream = null; try { inputStream = response.getResponseStream(); Parser parser = new Parser(WMTS_CONFIGURATION); object = parser.parse(new InputSource(inputStream)); } catch (SAXException | ParserConfigurationException e) { throw (ServiceException) new ServiceException("Error while parsing XML.") .initCause(e); } finally { IOUtils.closeQuietly(inputStream); } if (object instanceof ServiceException) { throw (ServiceException) object; } this.capabilities = new WMTSCapabilities((CapabilitiesType) object); } finally { response.dispose(); } }
Source:
public final void setSendTimeoutExpression(Expression sendTimeoutExpression) { Assert.notNull(sendTimeoutExpression, "'sendTimeoutExpression' must not be null"); this.sendTimeoutExpression = sendTimeoutExpression; }

Target:
public void setSendTimeoutExpression(Expression sendTimeoutExpression) { Assert.notNull(sendTimeoutExpression, "'sendTimeoutExpression' must not be null"); this.sendTimeoutExpression = sendTimeoutExpression; }
Source:
public String getElapsedTime(DashboardData data) { XPathXMLParser parser = getParser(data.getResponseXML()); if (null == parser) { return ""; } long elapsed = 0; String startTime = parser.getString(" final long startTimeInMillis = DatatypeConverter.parseDateTime(startTime).getTimeInMillis(); if (data.getOutputXML() == null) { elapsed = System.currentTimeMillis() - startTimeInMillis; } else { elapsed = Timestamp.valueOf(data.getCompletedTimestamp()).getTime() - startTimeInMillis; } StringBuilder elapsedTime = new StringBuilder(); long days = elapsed / MILLIS_PER_DAY; if (days > 0) { elapsed = elapsed - days * MILLIS_PER_DAY; elapsedTime.append(days).append("d "); } long hours = elapsed / MILLIS_PER_HOUR; if (hours > 0) { elapsed = elapsed - hours * MILLIS_PER_HOUR; elapsedTime.append(hours).append("h "); } long minutes = elapsed / MILLIS_PER_MIN; if (minutes > 0) { elapsed = elapsed - minutes * MILLIS_PER_MIN; elapsedTime.append(minutes).append("m "); } long seconds = elapsed / 1000; elapsedTime.append(seconds).append("s"); return elapsedTime.toString(); }

Target:
public String getElapsedTime(DashboardData data) throws XPathExpressionException { XPathXMLParser parser = new XPathXMLParser(data.getResponseXML()); String startTime = parser.getString(CREATION_TIME_XPATH); final long startTimeInMillis = DatatypeConverter.parseDateTime(startTime).getTimeInMillis(); long elapsed = 0; if (data.getOutputXML() == null) { elapsed = System.currentTimeMillis() - startTimeInMillis; } else { elapsed = Timestamp.valueOf(data.getCompletedTimestamp()).getTime() - startTimeInMillis; } return convertMilliTimeToHumanReadable(elapsed); }