auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void doStart() { try { this.server.start(); } catch (Throwable exc) { LOG.error("Got unexpected exception while starting BookieServer", exc); if (uncaughtExceptionHandler != null) { LOG.error("Calling uncaughtExceptionHandler"); uncaughtExceptionHandler.uncaughtException(Thread.currentThread(), exc); } else { throw new RuntimeException("Failed to start bookie server", exc); } } }

Target:
protected void doStart() { try { this.server.start(); } catch (InterruptedException exc) { throw new RuntimeException("Failed to start bookie server", exc); } }
Source:
public CacheHandler createCache() { ConcurrentMap<String, String> cache; String mapDbKey; while (true) { mapDbKey = mapDbKeyCounter.getAndIncrement() + ""; try { HTreeMap<String, String> hTreeMap = mmapDB.createHashMap(mapDbKey).make(); cache = new CacheProxy(hTreeMap); cacheCount.incrementAndGet(); break; } catch (IllegalArgumentException e) { } } MapDbCacheDisposer cacheDisposer = new MapDbCacheDisposer(mapDbKey); Cleaner cleaner = Cleaner.create(cache, cacheDisposer); MapDbCacheDisposerAndCleaner disposerAndCleaner = new MapDbCacheDisposerAndCleaner( cacheDisposer, cleaner ); return new CacheHandler(this, cache, disposerAndCleaner); }

Target:
public CacheHandler createCache() { ConcurrentMap<String, String> cache; String mapDbKey; while (true) { mapDbKey = Long.toString(mapDbKeyCounter.getAndIncrement()); try { HTreeMap<String, String> hTreeMap = mmapDB.createHashMap(mapDbKey).make(); cache = new CacheProxy(hTreeMap); cacheCount.incrementAndGet(); break; } catch (IllegalArgumentException e) { } } MapDbCacheDisposer cacheDisposer = new MapDbCacheDisposer(mapDbKey); Cleaner cleaner = Cleaner.create(cache, cacheDisposer); MapDbCacheDisposerAndCleaner disposerAndCleaner = new MapDbCacheDisposerAndCleaner( cacheDisposer, cleaner ); return new CacheHandler(this, cache, disposerAndCleaner); }
Source:
public Image getIcon() { return Pics.getImage("page.png", UIDesignerPlugin.getDefault()); }

Target:
public Image getIcon() { return Pics.getImage(PAGE_ICON_PATH, UIDesignerPlugin.getDefault()); }
Source:
public PrologEnvironment newPrologEnvironment() throws CompileException, IOException{ PrologEnvironment env = envFactory.create(getClass().getClassLoader()); ObjectStream ruleStream; ruleStream = getPrologRules(); if (ruleStream != null) { try { PushbackReader in = new PushbackReader(new InputStreamReader(ruleStream, Charset.forName("UTF-8")), Prolog.PUSHBACK_SIZE); JavaObjectTerm streamObject = new JavaObjectTerm(in); if (!env.execute(Prolog.BUILTIN, "consult_stream", SymbolTerm.makeSymbol("rules.pl"), streamObject)) { throw new CompileException("Cannot consult " + getProject().getName() + " " + getConfig().getRevision()); } } finally { ruleStream.close(); } } else { VariableTerm var = new VariableTerm(); StructureTerm head = new StructureTerm("submit_rule", var); StructureTerm defaultRule = new StructureTerm(":", SymbolTerm.makeSymbol("com.google.gerrit.rules.common"), new StructureTerm("default_submit", var)); StructureTerm clause = new StructureTerm(":-", head, defaultRule); env.execute(Prolog.BUILTIN, "assertz", clause); } return env; }

Target:
public PrologEnvironment newPrologEnvironment() throws CompileException { PrologEnvironment env = envFactory.create(getClass().getClassLoader()); String rules; try { rules = getPrologRules(); } catch (RepositoryNotFoundException err) { throw new CompileException("Local repository does not exist ", err); } if (rules != null) { PushbackReader in = new PushbackReader(new StringReader(rules), Prolog.PUSHBACK_SIZE); JavaObjectTerm streamObject = new JavaObjectTerm(in); if (!env.execute(Prolog.BUILTIN, "consult_stream", SymbolTerm.makeSymbol("rules.pl"), streamObject)) { throw new CompileException("Cannot consult rules.pl " + getProject().getName() + " " + getConfig().getRevision()); } } return env; }
Source:
private static void testDownloadLatestDbBackup() throws MambuApiException, IOException { methodName = new Object() {}.getClass().getEnclosingMethod().getName(); System.out.println(methodName = "\nIn " + methodName); DatabaseService databaseService = MambuAPIFactory.getDatabaseService(); DatabaseBackup response = databaseService.downloadLatestDbBackup(); System.out.println("Backup was successfuly downloaded = " + (response.getContent().toByteArray() != null)); }

Target:
private static void testDownloadLatestDbBackup() throws MambuApiException { methodName = new Object() {}.getClass().getEnclosingMethod().getName(); System.out.println(methodName = "\nIn " + methodName); DatabaseService databaseService = MambuAPIFactory.getDatabaseService(); DatabaseBackup response = databaseService.downloadLatestDbBackup(); System.out.println("Backup was successfuly downloaded = " + (response.getContent().toByteArray() != null)); }
Source:
private void proceedGuaranteedMemoryCheck() { for (VmInternalData vmInternalData : _runningVms.values()) { VM savedVm = _vmDict.get(vmInternalData.getVmDynamic().getId()); if (vmInternalData.getVmStatistics().getCurrentMemory() != null && savedVm.getMinAllocatedMem() > vmInternalData.getVmStatistics().getCurrentMemory()) { AuditLogableBase auditLogable = new AuditLogableBase(); auditLogable.setVmId(savedVm.getId()); AuditLogDirector.log(auditLogable, AuditLogType.VM_MEMORY_UNDER_GUARANTEED_VALUE); } } }

Target:
private void proceedGuaranteedMemoryCheck() { for (VmInternalData vmInternalData : _runningVms.values()) { VM savedVm = _vmDict.get(vmInternalData.getVmDynamic().getId()); VmStatistics vmStatistics = vmInternalData.getVmStatistics(); if (vmStatistics.getCurrentMemory() != null && savedVm.getMinAllocatedMem() > vmStatistics.getCurrentMemory()) { AuditLogableBase auditLogable = new AuditLogableBase(); auditLogable.addCustomValue("VmName", savedVm.getName()); auditLogable.addCustomValue("VdsName", this._vds.getName()); auditLogable.addCustomValue("MemGuaranteed", String.valueOf(savedVm.getMinAllocatedMem())); auditLogable.addCustomValue("MemActual", vmStatistics.getCurrentMemory().toString()); auditLog(auditLogable, AuditLogType.VM_MEMORY_UNDER_GUARANTEED_VALUE); } } }
Source:
private void createTextMenu() { final MenuManager popupManager = new MenuManager(); textWidget.setMenu(popupManager.createContextMenu(textWidget)); textWidget.addDisposeListener(e -> { popupManager.dispose(); }); }

Target:
private void createTextMenu() { final MenuManager popupManager = new MenuManager(); textWidget.setMenu(popupManager.createContextMenu(textWidget)); textWidget.addDisposeListener(e -> popupManager.dispose()); }
Source:
protected void logToAudit(){ super.logToAudit(); if (isPolicyResetMessage(getReturnStatus().message)) { return; } AuditLogableBase auditLogableBase = new AuditLogableBase(vds.getId()); auditLogableBase.setVds(vds); auditLogableBase.addCustomValue("message", getReturnStatus().message); auditLogDirector.log(auditLogableBase, AuditLogType.VDS_BROKER_COMMAND_FAILURE); }

Target:
protected void logToAudit(){ if (isPolicyResetMessage(getReturnStatus().message)) { return; } AuditLogableBase auditLogableBase = new AuditLogableBase(vds.getId()); auditLogableBase.setVds(vds); auditLogableBase.addCustomValue("message", getReturnStatus().message); auditLogDirector.log(auditLogableBase, AuditLogType.VDS_BROKER_COMMAND_FAILURE); }
Source:
public Map<String, InputStream> getDomainFilesData( final String domainId ) { lock.readLock().lock(); try { if ( !metadataMapping.getDomainIds().contains( domainId ) ) { return emptyMap(); } Map<String, InputStream> localeFiles = ofNullable( metadataMapping.getLocaleFiles( domainId ) ).orElse( emptyMap() ).entrySet().stream() .collect( toMap( entry -> "messages_" + entry.getKey() + ".properties", item -> getRepositoryFileInputStream( item.getValue() ) ) ); return ImmutableMap.<String, InputStream>builder() .putAll( localeFiles ) .put( domainId, getRepositoryFileInputStream( metadataMapping.getDomainFile( domainId ) ) ) .build(); } finally { lock.readLock().unlock(); } }

Target:
public Map<String, InputStream> getDomainFilesData( final String domainId ) { lock.readLock().lock(); try { if ( !metadataMapping.getDomainIds().contains( domainId ) ) { return emptyMap(); } Map<String, InputStream> localeFiles = ofNullable( metadataMapping.getLocaleFiles( domainId ) ).orElse( emptyMap() ).entrySet().stream() .collect( toMap( entry -> "messages_" + entry.getKey() + ".properties", item -> getRepositoryFileInputStream( item.getValue() ) ) ); return ImmutableMap.<String, InputStream>builder() .putAll( localeFiles ) .put( getXmiFilename( domainId ), getRepositoryFileInputStream( metadataMapping.getDomainFile( domainId ) ) ) .build(); } finally { lock.readLock().unlock(); } }
Source:
public final void updateMetadata(Path outputFile) { try { String location = outputFile.toAbsolutePath().toString(); NetcdfFileWriter nc = NetcdfFileWriter.openExisting(location); GridDataset gridDs = GridDataset.open(location); nc.setRedefineMode(true); for (Attribute newAttr : getGlobalAttributesToUpdate(nc.getNetcdfFile())) { nc.addGroupAttribute(null, newAttr); } nc.setRedefineMode(false); nc.close(); } catch (IOException e) { throw new GoGoDuckException(String.format("Failed updating metadata for file '%s': '%s'", outputFile, e.getMessage())); } }

Target:
public final void updateMetadata(Path outputFile) throws Exception { NetcdfFileWriter nc = null; try { String location = outputFile.toAbsolutePath().toString(); nc = NetcdfFileWriter.openExisting(location); nc.setRedefineMode(true); for (Attribute newAttr : getGlobalAttributesToUpdate(nc.getNetcdfFile())) { nc.addGroupAttribute(null, newAttr); } nc.setRedefineMode(false); } catch (IOException e) { throw new GoGoDuckException(String.format("Failed updating metadata for file '%s': '%s'", outputFile, e.getMessage())); } finally { close(nc, NetcdfFileWriter.class); } }
Source:
private void handleReviewResultErrors(final ReviewResult result) { for (ReviewResult.Error resultError : result.getErrors()) { String errMsg = "error: (change " + result.getChangeId() + ") "; switch (resultError.getType()) { case ABANDON_NOT_PERMITTED: errMsg += "not permitted to abandon change"; break; case RESTORE_NOT_PERMITTED: errMsg += "not permitted to restore change"; break; case SUBMIT_NOT_PERMITTED: errMsg += "not permitted to submit change"; break; case SUBMIT_NOT_READY: errMsg += "approvals or dependencies lacking"; break; case CHANGE_IS_CLOSED: errMsg += "change is closed"; break; case PUBLISH_NOT_PERMITTED: errMsg += "not permitted to publish change"; break; case DELETE_NOT_PERMITTED: errMsg += "not permitted to delete change"; break; case RULE_ERROR: errMsg += "rule error"; break; case GIT_ERROR: errMsg += "error writing change to git repository"; break; default: errMsg += "failure in review"; } if (resultError.getMessage() != null) { errMsg += ": " + resultError.getMessage(); } writeError(errMsg); } }

Target:
private void handleReviewResultErrors(final ReviewResult result) { for (ReviewResult.Error resultError : result.getErrors()) { String errMsg = "error: (change " + result.getChangeId() + ") "; switch (resultError.getType()) { case ABANDON_NOT_PERMITTED: errMsg += "not permitted to abandon change"; break; case RESTORE_NOT_PERMITTED: errMsg += "not permitted to restore change"; break; case SUBMIT_NOT_PERMITTED: errMsg += "not permitted to submit change"; break; case SUBMIT_NOT_READY: errMsg += "approvals or dependencies lacking"; break; case CHANGE_IS_CLOSED: errMsg += "change is closed"; break; case PUBLISH_NOT_PERMITTED: errMsg += "not permitted to publish change"; break; case DELETE_NOT_PERMITTED: errMsg += "not permitted to delete change/patch set"; break; case RULE_ERROR: errMsg += "rule error"; break; case GIT_ERROR: errMsg += "error writing change to git repository"; break; default: errMsg += "failure in review"; } if (resultError.getMessage() != null) { errMsg += ": " + resultError.getMessage(); } writeError(errMsg); } }
Source:
static String detail(Throwable t) { String detail = null; if (log.isDebugEnabled()) { StringWriter sw = new StringWriter(); detail = sw.toString(); log.debug("", t); } else { detail = t.getMessage(); } return detail; }

Target:
static String detail(Throwable t) { String detail = null; if (log.isDebugEnabled()) { StringWriter sw = new StringWriter(); t.printStackTrace(new PrintWriter(sw, true)); detail = sw.toString(); } else { detail = t.getMessage(); } return detail; }
Source:
public void unbindWhenUnsubscribed() { Merlin merlin = mock(Merlin.class); Subscription subscription = MerlinObservable.from(merlin) .subscribe(); subscription.unsubscribe(); verify(merlin, times(1)).unbind(); }

Target:
public void unbindWhenUnsubscribed() { Subscription subscription = MerlinObservable.from(merlin) .subscribe(); subscription.unsubscribe(); verify(merlin).unbind(); }
Source:
public Gml3ToWktImpl(Configuration gmlConfiguration) { parser = ThreadLocal.withInitial( () -> { Parser parser = new Parser(gmlConfiguration); parser.setStrict(false); return parser; }); }

Target:
public Gml3ToWktImpl(Configuration gmlConfiguration) { parser = ThreadLocal.withInitial( () -> { Parser gmlParser = new Parser(gmlConfiguration); gmlParser.setStrict(false); return gmlParser; }); }
Source:
public static VdcParameter deserialize(String key) { Map<String, String> map = new HashMap<String, String>(); for (String token : key.split(";")) { String[] keyVal = token.split("="); map.put(keyVal[0], keyVal[1]); } switch (Integer.parseInt(map.get(VERSION_KEY))) { case 0: synchronized (parametersMap) { return parametersMap.get(new Guid(map.get(GUID_KEY))); } default: throw new InvalidParameterKeyException(key); } }

Target:
public static VdcParameter deserialize(String key) { Map<String, String> map = new HashMap<String, String>(); for (String token : key.split(";")) { String[] keyVal = token.split("="); map.put(keyVal[0], keyVal[1]); } switch (Integer.parseInt(map.get(VERSION_KEY))) { case 0: synchronized (parametersMap) { Guid guid = new Guid(map.get(GUID_KEY)); if (!parametersMap.containsKey(guid)) { throw new InvalidParameterKeyException("VdcParameter with guid not found "+ guid.toString()); } return parametersMap.get(guid); } default: throw new InvalidParameterKeyException("Error deserializing VdcParameter from key " + key); } }
Source:
public List<JavaFileScannerContext.Location> flow(int parameterIndex) { if(node == null || behavior == null) { return Lists.newArrayList(); } return FlowComputation.flow(node, behavior.parameters().get(parameterIndex)); }

Target:
public List<JavaFileScannerContext.Location> flow(int parameterIndex) { if(node == null || behavior == null) { return Lists.newArrayList(); } if(parameterIndex < 0) { return FlowComputation.flow(node, node.programState.exitValue()); } return FlowComputation.flow(node, behavior.parameters().get(parameterIndex)); }
Source:
private PRPAIN201306UV02 sendToAdapter(PRPAIN201305UV02 request, AssertionType assertion) throws PatientDiscoveryException { AdapterPatientDiscoveryProxy proxy = adapterFactory.create(); return proxy.respondingGatewayPRPAIN201305UV02(request, assertion); }

Target:
private PRPAIN201306UV02 sendToAdapter(PRPAIN201305UV02 request, AssertionType assertion) throws PatientDiscoveryException { return adapterFactory.create().respondingGatewayPRPAIN201305UV02(request, assertion); }
Source:
protected Rectangle getBox() { PrecisionRectangle rBox = null; if ((getOwner().getChildren().get(0)) instanceof IRoundedRectangleFigure) { rBox = new PrecisionRectangle(((IRoundedRectangleFigure) ((IFigure) getOwner().getChildren().get(0))).getRoundedRectangleBounds()); } else if ((getOwner().getChildren().get(0)) instanceof IFigure) { rBox = new PrecisionRectangle(((IFigure) getOwner()).getBounds()); } ((IFigure) getOwner().getChildren().get(0)).translateToAbsolute(rBox); return rBox.expand(offset.width, offset.height); }

Target:
protected Rectangle getBox() { PrecisionRectangle rBox = null; Object figure = getFigure(); if (figure instanceof IRoundedRectangleFigure) { rBox = new PrecisionRectangle(((IRoundedRectangleFigure) ((IFigure) figure)).getRoundedRectangleBounds()); } else if (figure instanceof IFigure) { rBox = new PrecisionRectangle(((IFigure) getOwner()).getBounds()); } ((IFigure) figure).translateToAbsolute(rBox); return rBox.expand(offset.width, offset.height); }
Source:
private void insertMetricsInBatch(Multimap<Locator, IMetric> map, Granularity granularity) { BatchStatement batch = new BatchStatement(BatchStatement.Type.UNLOGGED); for (Locator locator : map.keySet()) { for (IMetric metric : map.get(locator)) { RollupType rollupType = metric.getRollupType(); DAbstractMetricIO io = rollupTypeToIO.get(rollupType); BoundStatement boundStatement = io.getBoundStatementForMetric(metric, granularity); batch.add(boundStatement); if( !LocatorCache.getInstance().isLocatorCurrentInBatchLayer(locator) ) { LocatorCache.getInstance().setLocatorCurrentInBatchLayer(locator); batch.add(locatorIO.getBoundStatementForLocator( locator )); } if ( isRecordingDelayedMetrics ) { BoundStatement bs = getBoundStatementForMetricIfDelayed(metric); if ( bs != null ) { batch.add(bs); } } } } LOG.trace(String.format("insert preaggregated batch statement size=%d", batch.size())); try { DatastaxIO.getSession().execute(batch); } catch ( Exception ex ) { Instrumentation.markWriteError(); LOG.error(String.format("error writing batch of %d preaggregated metrics", batch.size()), ex ); } }

Target:
private void insertMetricsInBatch(Multimap<Locator, IMetric> map, Granularity granularity) { BatchStatement batch = new BatchStatement(BatchStatement.Type.UNLOGGED); for (Locator locator : map.keySet()) { for (IMetric metric : map.get(locator)) { RollupType rollupType = metric.getRollupType(); DAbstractMetricIO io = rollupTypeToIO.get(rollupType); BoundStatement boundStatement = io.getBoundStatementForMetric(metric, granularity); batch.add(boundStatement); if (granularity == Granularity.FULL) { Instrumentation.markFullResPreaggregatedMetricWritten(); } if( !LocatorCache.getInstance().isLocatorCurrentInBatchLayer(locator) ) { LocatorCache.getInstance().setLocatorCurrentInBatchLayer(locator); batch.add(locatorIO.getBoundStatementForLocator( locator )); } if ( isRecordingDelayedMetrics ) { BoundStatement bs = getBoundStatementForMetricIfDelayed(metric); if ( bs != null ) { batch.add(bs); } } } } LOG.trace(String.format("insert preaggregated batch statement size=%d", batch.size())); try { DatastaxIO.getSession().execute(batch); } catch ( Exception ex ) { Instrumentation.markWriteError(); LOG.error(String.format("error writing batch of %d preaggregated metrics", batch.size()), ex ); } }
Source:
public void run(CombinedTimeLockServerConfiguration configuration, Environment environment) throws JsonProcessingException { environment.getObjectMapper() .registerModule(new Jdk8Module()) .registerModule(new JavaTimeModule()); environment.jersey().register(ConjureJerseyFeature.INSTANCE); environment.jersey().register(new EmptyOptionalTo204ExceptionMapper()); MetricsManager metricsManager = MetricsManagers.of(environment.metrics(), taggedMetricRegistry); Consumer<Object> registrar = component -> environment.jersey().register(component); log.error("Paxos configuration\n{}", environment.getObjectMapper() .writerWithDefaultPrettyPrinter() .writeValueAsString(configuration.install().paxos())); TimeLockAgent timeLockAgent = TimeLockAgent.create( metricsManager, configuration.install(), configuration::runtime, USER_AGENT, CombinedTimeLockServerConfiguration.threadPoolSize(), CombinedTimeLockServerConfiguration.blockingTimeoutMs(), registrar); environment.lifecycle().manage(new Managed() { @Override public void start() { } @Override public void stop() { timeLockAgent.shutdown(); } }); }

Target:
public void run(CombinedTimeLockServerConfiguration configuration, Environment environment) throws JsonProcessingException { environment.getObjectMapper() .registerModule(new Jdk8Module()) .registerModule(new JavaTimeModule()); environment.jersey().register(ConjureJerseyFeature.INSTANCE); environment.jersey().register(new EmptyOptionalTo204ExceptionMapper()); MetricsManager metricsManager = MetricsManagers.of(environment.metrics(), taggedMetricRegistry); Consumer<Object> registrar = component -> environment.jersey().register(component); log.info("Paxos configuration\n{}", environment.getObjectMapper() .writerWithDefaultPrettyPrinter() .writeValueAsString(configuration.install().paxos())); TimeLockAgent timeLockAgent = TimeLockAgent.create( metricsManager, configuration.install(), configuration::runtime, USER_AGENT, CombinedTimeLockServerConfiguration.threadPoolSize(), CombinedTimeLockServerConfiguration.blockingTimeoutMs(), registrar); environment.lifecycle().manage(new Managed() { @Override public void start() { } @Override public void stop() { timeLockAgent.shutdown(); } }); }
Source:
public void checkAttributeValue(PerunSessionImpl perunSession, Resource resource, Attribute attribute) throws InternalErrorException, WrongAttributeValueException, WrongReferenceAttributeValueException, WrongAttributeAssignmentException { String id = (String) attribute.getValue(); if (id == null) { throw new WrongAttributeValueException(attribute, resource, "Attribute can't be empty."); } Matcher match = pattern.matcher(id); if (!match.matches()) { throw new WrongAttributeValueException(attribute, resource, "Bad format of attribute redmineProjectID. It can start with a-z and then a-z, 0-9, _ or -"); } }

Target:
public void checkAttributeValue(PerunSessionImpl perunSession, Resource resource, Attribute attribute) throws InternalErrorException, WrongAttributeValueException, WrongReferenceAttributeValueException, WrongAttributeAssignmentException { String id = (String) attribute.getValue(); if (id == null) { throw new WrongAttributeValueException(attribute, resource, "Attribute can't be empty. It can start with a-z and then a-z, 0-9, _ or -"); } Matcher match = pattern.matcher(id); if (!match.matches()) { throw new WrongAttributeValueException(attribute, resource, "Bad format of attribute redmineProjectID. It can start with a-z and then a-z, 0-9, _ or -"); } }
Source:
String getLabel() { return "Staged"; }

Target:
String getLabel() { return UIText.StagedNode_Label; }
Source:
public void doGet(final HttpServletRequest request, final HttpServletResponse response) throws IOException, ServletException { String path = request.getPathInfo(); String fullPath = getFullPath(brandingManager.getBrandingRootPath().getAbsolutePath(), path); if (fullPath != null) { File file = new File(fullPath); if (!file.exists() || !file.canRead() || file.isDirectory()) { log.error("Unable to retrieve file: " + file.getAbsolutePath() + ", will send a 404 error response."); response.sendError(HttpServletResponse.SC_NOT_FOUND); } else { String etag = generateEtag(file); if (etag.equals(request.getHeader(GwtDynamicHostPageServlet. IF_NONE_MATCH_HEADER))) { response.setStatus(HttpServletResponse.SC_NOT_MODIFIED); } else { String mime = ServletUtils.getMimeMap(). getContentType(file); response.addHeader(GwtDynamicHostPageServlet.ETAG_HEADER, etag); ServletUtils.sendFile(request, response, file, mime); } } } else { response.sendError(HttpServletResponse.SC_NOT_FOUND); } }

Target:
public void doGet(final HttpServletRequest request, final HttpServletResponse response) throws IOException, ServletException { String path = request.getPathInfo(); String fullPath = getFullPath(brandingManager.getBrandingRootPath(), path); if (fullPath != null) { File file = new File(fullPath); if (!file.exists() || !file.canRead() || file.isDirectory()) { log.error("Unable to retrieve file: " + file.getAbsolutePath() + ", will send a 404 error response."); response.sendError(HttpServletResponse.SC_NOT_FOUND); } else { String etag = generateEtag(file); if (etag.equals(request.getHeader(GwtDynamicHostPageServlet. IF_NONE_MATCH_HEADER))) { response.setStatus(HttpServletResponse.SC_NOT_MODIFIED); } else { String mime = ServletUtils.getMimeMap(). getContentType(file); response.addHeader(GwtDynamicHostPageServlet.ETAG_HEADER, etag); ServletUtils.sendFile(request, response, file, mime); } } } else { response.sendError(HttpServletResponse.SC_NOT_FOUND); } }
Source:
public Response doExport(Action action) { validateParameters(action, "storageDomain.id|name"); try { ExportRepoImageParameters exportParameters = DiskHelper.getExportRepoImageParameters(getDisk(), getStorageDomainId(action)); return doAction(VdcActionType.ExportRepoImage, exportParameters, action); } catch (Exception e) { return handleError(e, action); } }

Target:
public Response doExport(Action action) { validateParameters(action, "storageDomain.id|name"); Disk disk = getDisk(); Guid sourceStorageDomainId = new Guid(disk.getStorageDomains().getStorageDomains().get(0).getId()); Guid sourceStoragePoolId = StorageDomainHelper.getStoragePoolIdForDomain(this, sourceStorageDomainId); ExportRepoImageParameters exportParameters = new ExportRepoImageParameters(new Guid(disk.getImageId())); exportParameters.setStoragePoolId(sourceStoragePoolId); exportParameters.setStorageDomainId(sourceStorageDomainId); exportParameters.setImageGroupID(new Guid(disk.getId())); exportParameters.setDestinationDomainId(getStorageDomainId(action)); return doAction(VdcActionType.ExportRepoImage, exportParameters, action); }
Source:
protected void processFiltered(File file, FileText fileText) throws CheckstyleException { if (CommonUtils.matchesFileExtension(file, getFileExtensions())) { final String msg = "%s occurred during the analysis of file %s."; final String fileName = file.getPath(); final FileContents contents = new FileContents(fileText); try { if (!ordinaryChecks.isEmpty() || !commentChecks.isEmpty()) { final DetailAST rootAST = parse(contents); if (!ordinaryChecks.isEmpty()) { walk(rootAST, contents, AstState.ORDINARY); } if (!commentChecks.isEmpty()) { final DetailAST astWithComments = appendHiddenCommentNodes(rootAST); walk(astWithComments, contents, AstState.WITH_COMMENTS); } } final SortedSet<LocalizedMessage> filteredMessages = getFilteredMessages(fileName, contents); addMessages(filteredMessages); messages.clear(); } catch (final TokenStreamRecognitionException tre) { final String exceptionMsg = String.format(Locale.ROOT, msg, "TokenStreamRecognitionException", fileName); throw new CheckstyleException(exceptionMsg, tre); } catch (RecognitionException | TokenStreamException ex) { final String exceptionMsg = String.format(Locale.ROOT, msg, ex.getClass().getSimpleName(), fileName); throw new CheckstyleException(exceptionMsg, ex); } } }

Target:
protected void processFiltered(File file, FileText fileText) throws CheckstyleException { if (CommonUtils.matchesFileExtension(file, getFileExtensions())) { final String msg = "%s occurred during the analysis of file %s."; final String fileName = file.getPath(); try { if (!ordinaryChecks.isEmpty() || !commentChecks.isEmpty()) { final FileContents contents = new FileContents(fileText); final DetailAST rootAST = parse(contents); if (!ordinaryChecks.isEmpty()) { walk(rootAST, contents, AstState.ORDINARY); } if (!commentChecks.isEmpty()) { final DetailAST astWithComments = appendHiddenCommentNodes(rootAST); walk(astWithComments, contents, AstState.WITH_COMMENTS); } final SortedSet<LocalizedMessage> filteredMessages = getFilteredMessages(fileName, contents); addMessages(filteredMessages); messages.clear(); } } catch (final TokenStreamRecognitionException tre) { final String exceptionMsg = String.format(Locale.ROOT, msg, "TokenStreamRecognitionException", fileName); throw new CheckstyleException(exceptionMsg, tre); } catch (RecognitionException | TokenStreamException ex) { final String exceptionMsg = String.format(Locale.ROOT, msg, ex.getClass().getSimpleName(), fileName); throw new CheckstyleException(exceptionMsg, ex); } } }
Source:
private static List<String> templateClasspathFor(File projectDir) { ProjectConnection connection = null; try { connection = GradleConnector.newConnector() .forProjectDirectory(projectDir) .useDistribution(new URI("<LINK_0>")) .connect(); KotlinBuildScriptModel model = connection.getModel(KotlinBuildScriptModel.class); List<String> classpath = Lists.newArrayList(); for (File entry : model.getClassPath()) { if (!entry.getName().startsWith("groovy")) { classpath.add(entry.getAbsolutePath()); } } return classpath; } catch (Exception e) { throw new RuntimeException(e); } finally { if (connection != null) { connection.close(); } } }

Target:
private static List<String> templateClasspathFor(File projectDir) { WorkspaceConfiguration config = CorePlugin.workspaceConfigurationManager().loadWorkspaceConfiguration(); KotlinBuildScriptModel model = KotlinModelQuery.execute(projectDir, GradleDistributionSerializer.INSTANCE.serializeToString(GradleDistribution.fromBuild()), config.getGradleUserHome(), config.isOffline()); List<String> classpath = Lists.newArrayList(); for (File entry : model.getClassPath()) { if (!entry.getName().startsWith("groovy")) { classpath.add(entry.getAbsolutePath()); } } return classpath; }
Source:
public Object loadObject(EntityProjection projection, Serializable id, RequestScope scope) { Class<?> entityClass = projection.getType(); FilterExpression filterExpression = projection.getFilterExpression(); try { EntityDictionary dictionary = scope.getDictionary(); Class<?> idType = dictionary.getIdType(entityClass); String idField = dictionary.getIdFieldName(entityClass); FilterPredicate idExpression; Path.PathElement idPath = new Path.PathElement(entityClass, idType, idField); if (id != null) { idExpression = new FilterPredicate(idPath, Operator.IN, Collections.singletonList(id)); } else { idExpression = new FilterPredicate(idPath, Operator.FALSE, Collections.emptyList()); } FilterExpression joinedExpression = (filterExpression != null) ? new AndFilterExpression(filterExpression, idExpression) : idExpression; projection = projection .copyOf() .filterExpression(joinedExpression) .build(); QueryWrapper query = (QueryWrapper) new RootCollectionFetchQueryBuilder(projection, dictionary, emWrapper) .build(); EntityGraph entityGraph = createEntityGraph(scope, projection); if (scope.getElideSettings() != null && scope.getElideSettings().isEnableJPAFetchToManyRelationship() && entityGraph != null) { return query.getQuery() .setHint("javax.persistence.loadgraph", entityGraph) .getSingleResult(); } else { return query.getQuery() .getSingleResult(); } } catch (NoResultException e) { return null; } }

Target:
public Object loadObject(EntityProjection projection, Serializable id, RequestScope scope) { Class<?> entityClass = projection.getType(); FilterExpression filterExpression = projection.getFilterExpression(); try { EntityDictionary dictionary = scope.getDictionary(); Class<?> idType = dictionary.getIdType(entityClass); String idField = dictionary.getIdFieldName(entityClass); FilterPredicate idExpression; Path.PathElement idPath = new Path.PathElement(entityClass, idType, idField); if (id != null) { idExpression = new FilterPredicate(idPath, Operator.IN, Collections.singletonList(id)); } else { idExpression = new FilterPredicate(idPath, Operator.FALSE, Collections.emptyList()); } FilterExpression joinedExpression = (filterExpression != null) ? new AndFilterExpression(filterExpression, idExpression) : idExpression; projection = projection .copyOf() .filterExpression(joinedExpression) .build(); QueryWrapper query = (QueryWrapper) new RootCollectionFetchQueryBuilder(projection, dictionary, emWrapper) .build(); if (scope.getElideSettings() != null && scope.getElideSettings().isUseJpaEntityGraphHint()) { return query.getQuery() .setHint("javax.persistence.loadgraph", createEntityGraph(scope, projection)) .getSingleResult(); } else { return query.getQuery() .getSingleResult(); } } catch (NoResultException e) { return null; } }
Source:
public FeedbackSessionAttributes getCopy() { return builder(feedbackSessionName, courseId, creatorEmail) .withInstructions(instructions) .withCreatedTime(createdTime) .withStartTime(startTime) .withEndTime(endTime) .withSessionVisibleFromTime(sessionVisibleFromTime) .withResultsVisibleFromTime(resultsVisibleFromTime) .withTimeZone(timeZone) .withGracePeriod(gracePeriod) .withFeedbackSessionType(feedbackSessionType) .withSentOpenEmail(sentOpenEmail) .withSentClosingEmail(sentClosingEmail) .withSentClosedEmail(sentClosedEmail) .withSentPublishedEmail(sentPublishedEmail) .withOpeningEmailEnabled(isOpeningEmailEnabled) .withPublishedEmailEnabled(isPublishedEmailEnabled) .withRespondingInstructorList(respondingInstructorList) .withRespondingStudentList(respondingStudentList) .withClosingEmailEnabled(isClosingEmailEnabled) .build(); }

Target:
public FeedbackSessionAttributes getCopy() { return valueOf(toEntity()); }
Source:
public void performSearchNoDoiCitingMode() throws FetcherException { assertThrows(FetcherException.class, () -> openCitationFetcher.searchCiting(new BibEntry())); }

Target:
public void performSearchNoDoiCitingMode() throws FetcherException { assertEquals(Collections.emptyList(), openCitationFetcher.searchCiting(new BibEntry())); }
Source:
public void testMac_correctAlias() throws Exception { Provider androidOpenSSLProvider = Security.getProvider("AndroidOpenSSL"); assertFalse("HmacSHA256".equals( androidOpenSSLProvider.get("Alg.Alias.Mac.1.2.840.113549.2.9"))); assertEquals("HmacSHA256", androidOpenSSLProvider.get("Alg.Alias.Mac.1.2.840.113549.2.8")); }

Target:
public void testMac_correctAlias() throws Exception { Provider androidOpenSSLProvider = Security.getProvider("AndroidOpenSSL"); assertFalse("HmacSHA224".equals( androidOpenSSLProvider.get("Alg.Alias.Mac.1.2.840.113549.2.9"))); assertEquals("HmacSHA224", androidOpenSSLProvider.get("Alg.Alias.Mac.1.2.840.113549.2.8")); }
Source:
public static Boolean equals( @OperatorDependency(operator = EQUAL, returnType = StandardTypes.BOOLEAN, argumentTypes = {"E", "E"}) MethodHandle equalsFunction, @TypeParameter("E") Type type, @SqlType("array(E)") Block leftArray, @SqlType("array(E)") Block rightArray) { if (leftArray.getPositionCount() != rightArray.getPositionCount()) { return false; } boolean foundNull = false; for (int i = 0; i < leftArray.getPositionCount(); i++) { if (leftArray.isNull(i) || rightArray.isNull(i)) { foundNull = true; continue; } Object leftElement = readNativeValue(type, leftArray, i); Object rightElement = readNativeValue(type, rightArray, i); try { Boolean result = (Boolean) equalsFunction.invoke(leftElement, rightElement); if (result == null) { foundNull = true; } else if (!result) { return false; } } catch (Throwable t) { throw internalError(t); } } if (foundNull) { return null; } return true; }

Target:
public static Boolean equals( @OperatorDependency(operator = EQUAL, returnType = StandardTypes.BOOLEAN, argumentTypes = {"E", "E"}) MethodHandle equalsFunction, @TypeParameter("E") Type type, @SqlType("array(E)") Block leftArray, @SqlType("array(E)") Block rightArray) { if (leftArray.getPositionCount() != rightArray.getPositionCount()) { return false; } boolean indeterminate = false; for (int i = 0; i < leftArray.getPositionCount(); i++) { if (leftArray.isNull(i) || rightArray.isNull(i)) { indeterminate = true; continue; } Object leftElement = readNativeValue(type, leftArray, i); Object rightElement = readNativeValue(type, rightArray, i); try { Boolean result = (Boolean) equalsFunction.invoke(leftElement, rightElement); if (result == null) { indeterminate = true; } else if (!result) { return false; } } catch (Throwable t) { throw internalError(t); } } if (indeterminate) { return null; } return true; }
Source:
public void cleanup() throws InterruptedException, IOException, StoreException { state.destroy(); assertTrue(tempDir.getAbsolutePath() + " could not be deleted", StoreTestUtils.cleanDirectory(tempDir, true)); indexScannerScheduler.shutdown(); if (!indexScannerScheduler.awaitTermination(1000, TimeUnit.MILLISECONDS)) { fail("Could not terminate index scanner task after BlobStoreStats shutdown"); } queueProcessorScheduler.shutdown(); if (!queueProcessorScheduler.awaitTermination(1000, TimeUnit.MILLISECONDS)) { fail("Could not terminate queue processor task after BlobStoreStats shutdown"); } }

Target:
public void cleanup() throws InterruptedException, IOException, StoreException { indexScannerScheduler.shutdown(); if (!indexScannerScheduler.awaitTermination(1000, TimeUnit.MILLISECONDS)) { fail("Could not terminate index scanner task after BlobStoreStats shutdown"); } queueProcessorScheduler.shutdown(); if (!queueProcessorScheduler.awaitTermination(1000, TimeUnit.MILLISECONDS)) { fail("Could not terminate queue processor task after BlobStoreStats shutdown"); } state.destroy(); assertTrue(tempDir.getAbsolutePath() + " could not be deleted", StoreTestUtils.cleanDirectory(tempDir, true)); }
Source:
public List<RepositoryView> getAllRepositories() { final List<MavenPomElementView> list = resolveXPathToAggregatedElementViewList( "/project final List<RepositoryView> result = new ArrayList<RepositoryView>( list.size() ); for ( final MavenPomElementView node : list ) { if ( node == null ) { continue; } RepositoryView repoDeclaration = new RepositoryView( node.getPomView(), node.getElement(), node.getOriginInfo() ); if ( repoDeclaration.getProfileId() != null ) { continue; } result.add( repoDeclaration ); } return result; }

Target:
public List<RepositoryView> getAllRepositories() { final List<MavenPomElementView> list = resolveXPathToAggregatedElementViewList( "/project final List<RepositoryView> result = new ArrayList<RepositoryView>( list.size() ); for ( final MavenPomElementView node : list ) { if ( node == null ) { continue; } result.add( new RepositoryView( node.getPomView(), node.getElement(), node.getOriginInfo() ) ); } return result; }
Source:
public String toString() { return "GlobalConfigurationBuilder{" + "evictionExecutorThreadPool=" + evictionThreadPool + "listenerExecutorThreadPool=" + listenerThreadPool + ", cl=" + cl + ", transport=" + transport + ", globalJmxStatistics=" + globalJmxStatistics + ", serialization=" + serialization + ", replicationQueueThreadPool=" + replicationQueueThreadPool + ", persistenceThreadPool=" + persistenceThreadPool + ", security=" + security + ", shutdown=" + shutdown + ", site=" + site + '}'; }

Target:
public String toString() { return "GlobalConfigurationBuilder{" + "evictionExecutorThreadPool=" + evictionThreadPool + ", listenerExecutorThreadPool=" + listenerThreadPool + ", cl=" + cl + ", transport=" + transport + ", globalJmxStatistics=" + globalJmxStatistics + ", serialization=" + serialization + ", replicationQueueThreadPool=" + replicationQueueThreadPool + ", persistenceThreadPool=" + persistenceThreadPool + ", security=" + security + ", shutdown=" + shutdown + ", site=" + site + '}'; }
Source:
public SaveParticipantPlugin() { super(); deltaVerifier = new ResourceDeltaVerifier(); }

Target:
public SaveParticipantPlugin() { deltaVerifier = new ResourceDeltaVerifier(); }
Source:
public void update(CruiseConfig modifiedConfig) throws Exception { PipelineTemplateConfig existingTemplateConfig = findAddedTemplate(modifiedConfig); TemplatesConfig templatesConfig = modifiedConfig.getTemplates(); existingTemplateConfig.setAuthorization(templateConfig.getAuthorization()); modifiedConfig.setTemplates(templatesConfig); }

Target:
public void update(CruiseConfig modifiedConfig) throws Exception { PipelineTemplateConfig existingTemplateConfig = findAddedTemplate(modifiedConfig); existingTemplateConfig.setAuthorization(authorization); }
Source:
public void setScore(int score) { this.score = score; update(); revalidate(); }

Target:
public void setScore(int score) { this.score = score; update(); }
Source:
public void testListScheduledMessages() throws Exception { Map<String, Object> filters = new LinkedHashMap<>(); filters.put("status", "scheduled"); final MessageList list = messageBirdClient.listMessagesFiltered(null, null, filters); assertNotNull(list.getOffset()); assertNotNull(list.getLinks()); assertNotNull(list.getTotalCount()); assertNotNull(list.getLinks()); }

Target:
public void testListScheduledMessages() throws Exception { final MessageList mockedResponse = new MessageList(); MessageBirdService messageBirdServiceMock = mock(MessageBirdService.class); MessageBirdClient messageBirdClientMock = new MessageBirdClient(messageBirdServiceMock); Map<String, Object> filters = new LinkedHashMap<>(); filters.put("status", "scheduled"); when(messageBirdServiceMock.requestList("/messages", filters, null, null, MessageList.class)) .thenReturn(mockedResponse); final MessageList response = messageBirdClientMock.listMessagesFiltered(null, null, filters); assertNotNull(response); assertEquals(response, mockedResponse); }
Source:
public T decode(Object input) { if (input == null) { return null; } ValueWrapper data = (ValueWrapper) input; ByteArrayInputStream bais = new ByteArrayInputStream(data.getValue()); try { try (ObjectInputStream ois = (whiteListedClasses != null) ? new WhiteListObjectInputStream(bais, whiteListedClasses) : new ObjectInputStream(bais)) { @SuppressWarnings("unchecked") T result = (T) ois.readObject(); return result; } catch (InvalidClassException e) { throw new RuntimeException(e.getMessage()); } catch (ClassNotFoundException e) { throw new RuntimeException("Could not load class", e); } } catch(IOException e) { } throw new AssertionError("Cannot reach here!"); }

Target:
public T decode(Object input) { if (input == null) { return null; } ValueWrapper data = (ValueWrapper) input; ByteArrayInputStream bais = new ByteArrayInputStream(data.getValue()); try (ObjectInputStream ois = new FilteredObjectInputStream(bais, isClassPermitted, classLoader)) { @SuppressWarnings("unchecked") T result = (T) ois.readObject(); return result; } catch (ClassNotFoundException | IOException e) { throw new RuntimeException("Could not load class", e); } }
Source:
public HelloWorldElement() { super(ElementFactory.createDiv()); UI.getCurrent().getPage().addHtmlImport( "frontend://bower_components/paper-input/paper-input.html"); Element input = new Element("paper-input"); Element greeting = ElementFactory.createDiv(); updateGreeting(input, greeting); input.synchronizeProperty("value", "value-changed"); input.addPropertyChangeListener("value", event -> updateGreeting(input, greeting)); input.setAttribute("id", "inputId"); greeting.setAttribute("id", "elementsGreeting"); getElement().appendChild(input, greeting); }

Target:
public HelloWorldElement() { super(ElementFactory.createDiv()); UI.getCurrent().getPage().addHtmlImport( "frontend://bower_components/paper-input/paper-input.html"); Element input = new Element("paper-input"); Element greeting = ElementFactory.createDiv(); updateGreeting(input, greeting); input.synchronizeProperty(VALUE_PROPERTY, "value-changed"); input.addPropertyChangeListener(VALUE_PROPERTY, event -> updateGreeting(input, greeting)); input.setAttribute("id", "inputId"); greeting.setAttribute("id", "elementsGreeting"); getElement().appendChild(input, greeting); }
Source:
boolean isUriValid(String uri) { String URL_PATTERN = "^/?(.*/)?(ac/|cas/)([a-f0-9]{64})$"; Matcher matcher = Pattern.compile(URL_PATTERN).matcher(uri); return matcher.matches(); }

Target:
static boolean isUriValid(String uri) { Matcher matcher = URI_PATTERN.matcher(uri); return matcher.matches(); }
Source:
public void processAttributeSet(String msg, MessageBeans beans) { if(beans.getAttribute() == null || beans.getUser() == null) { return; } try { log.debug("Setting attribute for user {}", beans.getAttribute(), beans.getUser()); if (beans.getAttribute().getNamespace().contains(":virt")) { perunUser.modifyEntry(beans.getUser(), ldapcManager.getPerunBl().getAttributesManager(). getAttribute(ldapcManager.getPerunSession(), beans.getUser(), beans.getAttribute().getName())); } else { perunUser.modifyEntry(beans.getUser(), beans.getAttribute()); } } catch (PerunException e) { log.error("Error setting attribute for user {}: {}", beans.getAttribute().getId(), beans.getUser().getId(), e); } }

Target:
public void processAttributeSet(String msg, MessageBeans beans) { if (beans.getAttribute() == null || beans.getUser() == null) { return; } try { log.debug("Setting attribute for user {}", beans.getAttribute(), beans.getUser()); perunUser.modifyEntry(beans.getUser(), beans.getAttribute()); } catch (NamingException | InternalErrorException e) { log.error("Error setting attribute for user {}: {}", beans.getAttribute().getId(), beans.getUser().getId(), e); } }
Source:
public static FileSystem getFileSystem() throws IOException { String coreSitePath = "/usr/local/hadoop/conf/core-site.xml"; Configuration configuration = new Configuration(); configuration.addResource(new Path(coreSitePath)); FileSystem fs = FileSystem.get(configuration); return fs; }

Target:
public static FileSystem getFileSystem() throws IOException { String coreSitePath = "/usr/local/hadoop/conf/core-site.xml"; Configuration configuration = new Configuration(); configuration.addResource(new Path(coreSitePath)); return FileSystem.get(configuration); }
Source:
public List<Task<? extends Serializable>> handle(Context context) throws SemanticException { AlterPartitionMessage msg = deserializer.getAlterPartitionMessage(context.dmd.getPayload()); String actualDbName = context.isDbNameEmpty() ? msg.getDB() : context.dbName; String actualTblName = context.isTableNameEmpty() ? msg.getTable() : context.tableName; Map<String, String> newPartSpec = new LinkedHashMap<>(); Map<String, String> oldPartSpec = new LinkedHashMap<>(); String tableName = actualDbName + "." + actualTblName; try { Table tblObj = msg.getTableObj(); Iterator<String> beforeIterator = msg.getPtnObjBefore().getValuesIterator(); Iterator<String> afterIterator = msg.getPtnObjAfter().getValuesIterator(); for (FieldSchema fs : tblObj.getPartitionKeys()) { oldPartSpec.put(fs.getName(), beforeIterator.next()); newPartSpec.put(fs.getName(), afterIterator.next()); } } catch (Exception e) { throw (e instanceof SemanticException) ? (SemanticException) e : new SemanticException("Error reading message members", e); } RenamePartitionDesc renamePtnDesc = new RenamePartitionDesc(tableName, oldPartSpec, newPartSpec, eventOnlyReplicationSpec(context)); Task<DDLWork> renamePtnTask = TaskFactory.get( new DDLWork(readEntitySet, writeEntitySet, renamePtnDesc), context.hiveConf); context.log.debug("Added rename ptn task : {}:{}->{}", renamePtnTask.getId(), oldPartSpec, newPartSpec); databasesUpdated.put(actualDbName, context.dmd.getEventTo()); tablesUpdated.put(tableName, context.dmd.getEventTo()); return Collections.singletonList(renamePtnTask); }

Target:
public List<Task<? extends Serializable>> handle(Context context) throws SemanticException { AlterPartitionMessage msg = deserializer.getAlterPartitionMessage(context.dmd.getPayload()); String actualDbName = context.isDbNameEmpty() ? msg.getDB() : context.dbName; String actualTblName = context.isTableNameEmpty() ? msg.getTable() : context.tableName; Map<String, String> newPartSpec = new LinkedHashMap<>(); Map<String, String> oldPartSpec = new LinkedHashMap<>(); String tableName = actualDbName + "." + actualTblName; try { Table tblObj = msg.getTableObj(); Iterator<String> beforeIterator = msg.getPtnObjBefore().getValuesIterator(); Iterator<String> afterIterator = msg.getPtnObjAfter().getValuesIterator(); for (FieldSchema fs : tblObj.getPartitionKeys()) { oldPartSpec.put(fs.getName(), beforeIterator.next()); newPartSpec.put(fs.getName(), afterIterator.next()); } } catch (Exception e) { throw (e instanceof SemanticException) ? (SemanticException) e : new SemanticException("Error reading message members", e); } RenamePartitionDesc renamePtnDesc = new RenamePartitionDesc( tableName, oldPartSpec, newPartSpec, context.eventOnlyReplicationSpec()); Task<DDLWork> renamePtnTask = TaskFactory.get( new DDLWork(readEntitySet, writeEntitySet, renamePtnDesc), context.hiveConf); context.log.debug("Added rename ptn task : {}:{}->{}", renamePtnTask.getId(), oldPartSpec, newPartSpec); databasesUpdated.put(actualDbName, context.dmd.getEventTo()); tablesUpdated.put(tableName, context.dmd.getEventTo()); return Collections.singletonList(renamePtnTask); }