auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void invalidate() { final long currentTime = System.currentTimeMillis(); for (Map.Entry<String, Long> workspaceExpireEntry : activeWorkspaces.entrySet()) { if (workspaceExpireEntry.getValue() <= currentTime) { try { String workspaceId = workspaceExpireEntry.getKey(); Workspace workspace = workspaceManager.getWorkspace(workspaceId); workspace.getAttributes().put(WORKSPACE_STOPPED_BY, ACTIVITY_CHECKER); workspaceManager.updateWorkspace(workspaceId, workspace); workspaceManager.stopWorkspace(workspaceId); } catch (NotFoundException e) { LOG.info("Workspace already stopped"); } catch (ConflictException e) { LOG.warn(e.getLocalizedMessage()); } catch (Exception ex) { LOG.error(ex.getLocalizedMessage()); LOG.debug(ex.getLocalizedMessage(), ex); } finally { activeWorkspaces.remove(workspaceExpireEntry.getKey()); } } } }

Target:
private void invalidate() { final long currentTime = System.currentTimeMillis(); for (Map.Entry<String, Long> workspaceExpireEntry : activeWorkspaces.entrySet()) { if (workspaceExpireEntry.getValue() <= currentTime) { try { String workspaceId = workspaceExpireEntry.getKey(); Workspace workspace = workspaceManager.getWorkspace(workspaceId); workspace.getAttributes().put(WORKSPACE_STOPPED_BY, ACTIVITY_CHECKER); workspaceManager.updateWorkspace(workspaceId, workspace); workspaceManager.stopWorkspace(workspaceId); } catch (NotFoundException ignored) { } catch (ConflictException e) { LOG.warn(e.getLocalizedMessage()); } catch (Exception ex) { LOG.error(ex.getLocalizedMessage()); LOG.debug(ex.getLocalizedMessage(), ex); } finally { activeWorkspaces.remove(workspaceExpireEntry.getKey()); } } } }
Source:
static void addFeatures() { List nonHunterCampBiomeCategories = Lists.newArrayList(Biome.Category.OCEAN, Biome.Category.THEEND, Biome.Category.NETHER, Biome.Category.ICY, Biome.Category.BEACH, Biome.Category.RIVER); for (Biome biome : ForgeRegistries.BIOMES.getValues()) { if (nonHunterCampBiomeCategories.contains(biome.getCategory())) continue; if (biome instanceof IFactionBiome && VReference.VAMPIRE_FACTION.equals(((IFactionBiome) biome).getFaction())) continue; VampirismBiomeFeatures.addHunterTent(biome); } }

Target:
static void addFeatures() { for (Biome biome : ForgeRegistries.BIOMES.getValues()) { if (!VampirismAPI.worldGenRegistry().canStructureBeGeneratedInBiome(ModFeatures.hunter_camp.getRegistryName(), biome)) continue; if (biome instanceof IFactionBiome && !VReference.HUNTER_FACTION.equals(((IFactionBiome) biome).getFaction())) continue; VampirismBiomeFeatures.addHunterTent(biome); } }
Source:
public ByteBuffer encode(@Nullable T value, @NonNull ProtocolVersion protocolVersion) { if (value == null) return null; try { return ByteBuffer.wrap(objectMapper.writeValueAsBytes(value)); } catch (JsonProcessingException e) { throw new InvalidTypeException(e.getMessage(), e); } }

Target:
public ByteBuffer encode(@Nullable T value, @NonNull ProtocolVersion protocolVersion) { if (value == null) { return null; } try { return ByteBuffer.wrap(objectMapper.writeValueAsBytes(value)); } catch (JsonProcessingException e) { throw new IllegalArgumentException(e.getMessage(), e); } }
Source:
private void launchUserBrickScriptActivity(Context context, UserBrick userBrick) { ((ScriptActivity) context).removeFormulaEditorFragment(); Intent intent = new Intent(context, UserBrickScriptActivity.class); ProjectManager.getInstance().setCurrentUserBrick(userBrick); context.startActivity(intent); }

Target:
private void launchUserBrickScriptActivity(Context context, UserBrick userBrick) { if (context instanceof ScriptActivity) { ((ScriptActivity) context).removeFormulaEditorFragment(); } Intent intent = new Intent(context, UserBrickScriptActivity.class); ProjectManager.getInstance().setCurrentUserBrick(userBrick); context.startActivity(intent); }
Source:
private void setServiceListPath(WebApplication webApplication) { String serviceListPathParamName = "service-list-path"; String serviceListPathParam = webApplication.getContext().getServletContext().getInitParameter(serviceListPathParamName); if ("".equals(serviceListPathParam) || serviceListPathParam == null) { Map<String, ? extends ServletRegistration> servletRegs = webApplication.getContext().getServletContext().getServletRegistrations(); for (ServletRegistration servletReg : servletRegs.values()) { serviceListPathParam = servletReg.getInitParameter(serviceListPathParamName); if (!"".equals(serviceListPathParam) || serviceListPathParam != null) { break; } } } if ("".equals(serviceListPathParam) || serviceListPathParam == null) { serviceListPathParam = "/services"; } else { serviceListPathParam = ""; } webApplication.setServiceListPath(serviceListPathParam); }

Target:
private void setServiceListPath(WebApplication webApplication) { String serviceListPathParamName = "service-list-path"; String serviceListPathParam = webApplication.getContext().getServletContext().getInitParameter(serviceListPathParamName); if (serviceListPathParam == null || "".equals(serviceListPathParam)) { Map<String, ? extends ServletRegistration> servletRegs = webApplication.getContext().getServletContext().getServletRegistrations(); for (ServletRegistration servletReg : servletRegs.values()) { serviceListPathParam = servletReg.getInitParameter(serviceListPathParamName); if (serviceListPathParam != null || !"".equals(serviceListPathParam) ) { break; } } } if (serviceListPathParam == null || "".equals(serviceListPathParam)) { serviceListPathParam = "/services"; } else { serviceListPathParam = ""; } webApplication.setServiceListPath(serviceListPathParam); }
Source:
public void abrirArquivosCodigoFonte(final List<File> arquivos) { if (arquivos != null && !arquivos.isEmpty()) { Lancador.getInstance().focarJanela(); SwingUtilities.invokeLater(() -> { TelaPrincipal.this.setEnabled(false); for (File arquivo : arquivos) { if (arquivoJaEstaAberto(arquivo)) { AbaCodigoFonte aba = obterAbaArquivo(arquivo); aba.selecionar(); } else { try { final String conteudo = FileHandle.open(arquivo); final AbaCodigoFonte abaCodigoFonte = AbaCodigoFonte.novaAba(); if(arquivo.getName().endsWith(".recuperado")) { abaCodigoFonte.setCodigoFonte(conteudo, null, true); } else{ PortugolStudio.getInstancia().salvarComoRecente(arquivo); abaCodigoFonte.setCodigoFonte(conteudo, arquivo, true); } getPainelTabulado().add(abaCodigoFonte); } catch (Exception excecao) { PortugolStudio.getInstancia().getTratadorExcecoes().exibirExcecao(excecao); } } } TelaPrincipal.this.setEnabled(true); }); } }

Target:
public void abrirArquivosCodigoFonte(final List<File> arquivos) { if (arquivos != null && !arquivos.isEmpty()) { Lancador.getInstance().focarJanela(); SwingUtilities.invokeLater(() -> { TelaPrincipal.this.setEnabled(false); for (File arquivo : arquivos) { if (arquivoJaEstaAberto(arquivo)) { AbaCodigoFonte aba = obterAbaArquivo(arquivo); aba.selecionar(); } else { try { final String conteudo = FileHandle.open(arquivo); final AbaCodigoFonte abaCodigoFonte = AbaCodigoFonte.novaAba(); if(PortugolStudio.getInstancia().isArquivoRecuperado(arquivo)) { abaCodigoFonte.setCodigoFonte(conteudo, null, true); } else{ PortugolStudio.getInstancia().salvarComoRecente(arquivo); abaCodigoFonte.setCodigoFonte(conteudo, arquivo, true); } getPainelTabulado().add(abaCodigoFonte); } catch (Exception excecao) { PortugolStudio.getInstancia().getTratadorExcecoes().exibirExcecao(excecao); } } } TelaPrincipal.this.setEnabled(true); }); } }
Source:
private void unregisterInstances(Collection<String> instances) { synchronized (_instanceMonitorMap) { for (String instanceName : instances) { _instanceMonitorMap.get(instanceName).unregister(); _instanceMonitorMap.remove(instanceName); } } }

Target:
private void unregisterInstances(Collection<String> instances) { synchronized (_instanceMonitorMap) { for (String instanceName : instances) { InstanceMonitor monitor = _instanceMonitorMap.remove(instanceName); if (monitor != null) { monitor.unregister(); } } } }
Source:
protected ArchiveOutputStream applyFormatOptions(ArchiveOutputStream s, Map<String, Object> o) throws IOException { for (Map.Entry<String, Object> p : o.entrySet()) { try { Field field = s.getClass().getDeclaredField(p.getKey()); field.setAccessible(true); field.set(s, p.getValue()); } catch (NoSuchFieldException | SecurityException | IllegalArgumentException | IllegalAccessException e) { throw new IOException("cannot set option: " + p.getKey(), e); } } return s; }

Target:
protected ArchiveOutputStream applyFormatOptions(ArchiveOutputStream s, Map<String, Object> o) throws IOException { for (Map.Entry<String, Object> p : o.entrySet()) { try { new Statement(s, "set" + StringUtils.capitalize(p.getKey()), new Object[]{p.getValue()}).execute(); } catch (Exception e) { throw new IOException("cannot set option: " + p.getKey(), e); } } return s; }
Source:
private byte[] getReadmeContent() { String filename = "README.blank"; try { return Resources.toByteArray(getClass().getClassLoader().getResource(filename)); } catch (IOException e) { LOG.warn("File %s not found so content of %s will be empty.", filename, README_FILE_NAME); return new byte[0]; } }

Target:
private byte[] getReadmeContent() { String filename = "README.blank"; try { return toByteArray(getResource(filename)); } catch (IOException e) { LOG.warn("File %s not found so content of %s will be empty.", filename, README_FILE_NAME); return new byte[0]; } }
Source:
public String generateAPIFromSwagger(String swaggerJsonString) throws APIException { if (swaggerJsonString == null || swaggerJsonString.isEmpty()) { if (log.isDebugEnabled()) { log.debug("Swagger provided is empty, hence returning empty API"); } return ""; } JsonParser jsonParser = new JsonParser(); JsonElement swaggerJson = jsonParser.parse(swaggerJsonString); if (swaggerJson.isJsonObject()) { APIGenerator apiGenerator = new APIGenerator(swaggerJson.getAsJsonObject()); try { API api = apiGenerator.generateSynapseAPI(); return APISerializer.serializeAPI(api).toString(); } catch (SwaggerGenException e) { String errorMsg = "Error occurred while generating API"; log.error(errorMsg, e); throw new APIException(errorMsg, e); } } else { String errorMsg = "Error in swagger definition format: should be a json object"; log.error(errorMsg); throw new APIException(errorMsg); } }

Target:
public String generateAPIFromSwagger(String swaggerJsonString) throws APIException { if (swaggerJsonString == null || swaggerJsonString.isEmpty()) { handleException(log, "Swagger provided is empty, hence unable to generate API", null); } JsonParser jsonParser = new JsonParser(); JsonElement swaggerJson = jsonParser.parse(swaggerJsonString); if (swaggerJson.isJsonObject()) { APIGenerator apiGenerator = new APIGenerator(swaggerJson.getAsJsonObject()); try { API api = apiGenerator.generateSynapseAPI(); return APISerializer.serializeAPI(api).toString(); } catch (APIGenException e) { handleException(log, "Error occurred while generating API", e); } } else { handleException(log, "Error in swagger definition format: should be a json object", null); } return ""; }
Source:
public Connection build() { try { setupLogger(); if (url == null) { throw new RuntimeException("The 'url' parameter is mandatory"); } if (!insecure && keyStorePath == null) { throw new RuntimeException("The 'keyStorePath' is mandatory in secure mode"); } if (keyStorePath != null && !new File(keyStorePath).exists()) { throw new RuntimeException( String.format("The keystore file '%s' doesn't exist'", keyStorePath) ); } urlobj = new URL(url); HttpConnection connection = new HttpConnection(); connection.setClient(createDefaultHttpClient()); connection.setUrl(url); connection.setUser(user); connection.setPassword(password); connection.setInsecure(insecure); connection.setDebug(debug); connection.setKerberos(kerberos); return connection; } catch (Exception e) { throw new RuntimeException(e); } }

Target:
public Connection build() { try { if (url == null) { throw new RuntimeException("The 'url' parameter is mandatory"); } if (!insecure && keyStorePath == null) { throw new RuntimeException("The 'keyStorePath' is mandatory in secure mode"); } if (keyStorePath != null && !new File(keyStorePath).exists()) { throw new RuntimeException( String.format("The keystore file '%s' doesn't exist'", keyStorePath) ); } urlobj = new URL(url); HttpConnection connection = new HttpConnection(); connection.setClient(createDefaultHttpClient()); connection.setUrl(url); connection.setUser(user); connection.setPassword(password); connection.setInsecure(insecure); connection.setDebug(debug); connection.setKerberos(kerberos); return connection; } catch (Exception e) { throw new RuntimeException(e); } }
Source:
public void tryBecomeLeader() { leaseId.getAndSet(leaseBlobManager.acquireLease(LEASE_TIME_IN_SEC, leaseId.get())); if (leaseId.get() != null) { LOG.info("Became leader!"); isLeader.set(true); leaderElectorListener.onBecomingLeader(); } }

Target:
public void tryBecomeLeader() { try { leaseId.getAndSet(leaseBlobManager.acquireLease(LEASE_TIME_IN_SEC, leaseId.get())); if (leaseId.get() != null) { LOG.info("Became leader with lease ID {}.", leaseId.get()); isLeader.set(true); if (leaderElectorListener != null) { leaderElectorListener.onBecomingLeader(); } } } catch (AzureException e) { LOG.error("Error while trying to acquire lease.", e); } }
Source:
public void getPrefixProvider_shouldDefaultProperly() { SequentialIdentifierGenerator gen = new SequentialIdentifierGenerator(); Assert.assertEquals("pre-", gen.getPrefixProvider("pre-").getValue()); Assert.assertEquals(" -", gen.getPrefixProvider(" -").getValue()); Assert.assertEquals("", gen.getPrefixProvider(null).getValue()); Assert.assertEquals("", gen.getPrefixProvider("").getValue()); Assert.assertEquals("", gen.getPrefixProvider(" ").getValue()); when(Context.getRegisteredComponent(eq(""), eq(PrefixProvider.class))).thenThrow(new APIException("Something went wrong with that bean.")); Assert.assertEquals("provider:", gen.getPrefixProvider("provider:").getValue()); when(Context.getRegisteredComponent(eq(" "), eq(PrefixProvider.class))).thenThrow(new APIException("Something went wrong with that bean.")); Assert.assertEquals("provider: ", gen.getPrefixProvider("provider: ").getValue()); when(Context.getRegisteredComponent(eq("fooBarBean"), eq(PrefixProvider.class))).thenThrow(new APIException("Something went wrong with that bean.")); Assert.assertEquals("provider:fooBarBean", gen.getPrefixProvider("provider:fooBarBean").getValue()); }

Target:
public void getPrefixProvider_shouldDefaultProperly() { SequentialIdentifierGenerator gen = new SequentialIdentifierGenerator(); Assert.assertEquals("pre-", gen.getPrefixProvider("pre-").getValue()); Assert.assertEquals(" -", gen.getPrefixProvider(" -").getValue()); Assert.assertEquals("", gen.getPrefixProvider(null).getValue()); Assert.assertEquals("", gen.getPrefixProvider("").getValue()); Assert.assertEquals("", gen.getPrefixProvider(" ").getValue()); }
Source:
protected HandlerAdapter configureListenerAdapter(MessagingMessageListenerAdapter messageListener) { List<InvocableHandlerMethod> invocableHandlerMethods = new ArrayList<InvocableHandlerMethod>(); for (Method method : this.methods) { invocableHandlerMethods.add(getMessageHandlerMethodFactory() .createInvocableHandlerMethod(getBean(), method)); } this.delegatingHandler = new DelegatingInvocableHandler(invocableHandlerMethods, this.bean, getResolver(), getBeanExpressionContext()); return new HandlerAdapter(this.delegatingHandler); }

Target:
protected HandlerAdapter configureListenerAdapter(MessagingMessageListenerAdapter messageListener) { List<InvocableHandlerMethod> invocableHandlerMethods = new ArrayList<InvocableHandlerMethod>(); for (Method method : this.methods) { invocableHandlerMethods.add(getMessageHandlerMethodFactory() .createInvocableHandlerMethod(getBean(), method)); } this.delegatingHandler = new DelegatingInvocableHandler(invocableHandlerMethods, getBean(), getResolver(), getBeanExpressionContext()); return new HandlerAdapter(this.delegatingHandler); }
Source:
public static Object fallback(InlineCache callSite, Object[] args) throws Throwable { MethodHandle target = (MethodHandle) args[0]; MethodHandle invoker = MethodHandles.dropArguments(target, 0, MethodHandle.class); MethodType type = invoker.type(); if (type.parameterType(type.parameterCount() - 1) == Object[].class) { if (target.isVarargsCollector() && isLastArgumentAnArray(type.parameterCount(), args)) { invoker = invoker.asFixedArity().asType(callSite.type()); } else { invoker = invoker.asCollector(Object[].class, callSite.type().parameterCount() - target.type().parameterCount()); } } if (callSite.contstant) { Object constantValue = invoker.invokeWithArguments(args); MethodHandle constant = MethodHandles.constant(constantValue.getClass(), constantValue); constant = MethodHandles.dropArguments(constant, 0, type.parameterArray()); callSite.setTarget(constant.asType(type)); return constantValue; } else { MethodHandle guard = GUARD.bindTo(target); MethodHandle root = guardWithTest(guard, invoker, callSite.fallback); callSite.setTarget(root); return invoker.invokeWithArguments(args); } }

Target:
public static Object fallback(InlineCache callSite, Object[] args) throws Throwable { MethodHandle target = (MethodHandle) args[0]; MethodHandle invoker = MethodHandles.dropArguments(target, 0, MethodHandle.class); MethodType type = invoker.type(); if (type.parameterType(type.parameterCount() - 1) == Object[].class) { if (target.isVarargsCollector() && isLastArgumentAnArray(type.parameterCount(), args)) { invoker = invoker.asFixedArity().asType(callSite.type()); } else { invoker = invoker.asCollector(Object[].class, callSite.type().parameterCount() - target.type().parameterCount()); } } if (callSite.constant) { Object constantValue = invoker.invokeWithArguments(args); MethodHandle constant; if (constantValue == null) { constant = MethodHandles.constant(Object.class, constantValue); } else { constant = MethodHandles.constant(constantValue.getClass(), constantValue); } constant = MethodHandles.dropArguments(constant, 0, type.parameterArray()); callSite.setTarget(constant.asType(type)); return constantValue; } else { MethodHandle guard = GUARD.bindTo(target); MethodHandle root = guardWithTest(guard, invoker, callSite.fallback); callSite.setTarget(root); return invoker.invokeWithArguments(args); } }
Source:
private void setupEmoji() { try { final RuntimeExceptionDao<Emoji, Object> dao = getDao(Emoji.class); if (dao.queryForAll().size() != 0) return; final String emojis[] = getAssets().list("emoji"); TransactionManager.callInTransaction(getDatabaseHelper() .getConnectionSource(), new Callable<Void>() { public Void call() throws Exception { for (String newEmoji : emojis) { if (newEmoji.endsWith(".png")) { newEmoji = newEmoji.substring(0, newEmoji.length() - 4); } dao.create(new Emoji(newEmoji)); } return null; } }); } catch (SQLException | IOException e) { ZLog.logException(e); } }

Target:
private void setupEmoji() { try { final RuntimeExceptionDao<Emoji, Object> dao = getDao(Emoji.class); if (dao.queryForAll().size() != 0) return; final String emojis[] = getAssets().list("emoji"); TransactionManager.callInTransaction(getDatabaseHelper() .getConnectionSource(), new Callable<Void>() { public Void call() throws Exception { for (String newEmoji : emojis) { newEmoji = newEmoji.replace(".png", ""); dao.create(new Emoji(newEmoji)); } return null; } }); } catch (SQLException | IOException e) { ZLog.logException(e); } }
Source:
private static System.LoggerFinder getSLF4JSystemLoggerFinder() { var loggerFinders = new ArrayList<System.LoggerFinder>(); ServiceLoader.load(System.LoggerFinder.class).forEach(loggerFinders::add); assertEquals("There should be exactly one `LoggerFinder`.", 1, loggerFinders.size()); var loggerFinder = loggerFinders.get(0); assertEquals("The `LoggerFinder` should be of type `SLF4JSystemLoggerFinder`.", SLF4JSystemLoggerFinder.class, loggerFinder.getClass()); return loggerFinder; }

Target:
private static System.LoggerFinder getSLF4JSystemLoggerFinder() { return ServiceLoader.load(System.LoggerFinder.class).stream() .filter(finderProvider -> SLF4JSystemLoggerFinder.class.isAssignableFrom(finderProvider.type())) .findAny() .map(ServiceLoader.Provider::get) .orElseThrow(); }
Source:
public void addProcessVariable(String variable, Object variableValue) { if (this.processVariables == null) { this.processVariables = new HashMap<String, Object>(); } this.processVariables.put(variable, variableValue); }

Target:
public void addProcessVariable(String variable, Object variableValue) { if (this.processVariables == null) { this.processVariables = new HashMap<>(); } this.processVariables.put(variable, variableValue); }
Source:
public void forceValue(MonitoringBaseElement element, String value) throws DeploymentException{ String request = MessageFormat.format(FORECE_VALUE, this.id++, value, element.getQualifiedString(), "true"); try { sendREQ(element.getResourceString(), request); } catch (IOException e) { throw new DeploymentException(MessageFormat.format(Messages.DeploymentExecutor_ForceValueFailed, element.getQualifiedString(), value), e); } }

Target:
public void forceValue(MonitoringBaseElement element, String value) throws DeploymentException{ String request = MessageFormat.format(FORCE_VALUE, this.id++, value, element.getQualifiedString(), "true"); try { sendREQ(element.getResourceString(), request); } catch (IOException e) { throw new DeploymentException(MessageFormat.format(Messages.DeploymentExecutor_ForceValueFailed, element.getQualifiedString(), value), e); } }
Source:
protected void assertObjectsEqual(final Object expected, final Object actual) { if (expected == null) { assertNull(actual); } else { assertNotNull("Should not be null", actual); if (actual.getClass().isArray()) { assertArrayEquals(expected, actual); } else { if (!expected.equals(actual)) { assertEquals(xstream.toXML(expected) + " vs. " + xstream.toXML(actual), expected, actual); } } } }

Target:
protected void assertObjectsEqual(final Object expected, final Object actual) { if (expected == null) { assertNull(actual); } else { assertNotNull("Should not be null", actual); if (actual.getClass().isArray()) { assertArrayEquals(expected, actual); } else { if (!expected.equals(actual)) { assertEquals("Object deserialization failed", "DESERIALIZED OBJECT\n" + xstream.toXML(expected), "DESERIALIZED OBJECT\n" + xstream.toXML(actual)); } } } }
Source:
private List<XmlClass> createXmlClasses(List<ITestNGMethod> methods, XmlTest srcXmlTest) { List<XmlClass> result = Lists.newArrayList(); Map<Class, Set<ITestNGMethod>> methodsMap = Maps.newHashMap(); for (ITestNGMethod m : methods) { Object instances = m.getInstance(); Class clazz = instances == null ? m.getRealClass() : instances.getClass(); Set<ITestNGMethod> methodList = methodsMap.get(clazz); if (null == methodList) { methodList = new HashSet<>(); methodsMap.put(clazz, methodList); } methodList.add(m); } Map<String, Map<String, String>> classParameters = new HashMap<String,Map<String, String>>(); for (XmlClass c : srcXmlTest.getClasses()) { classParameters.put(c.getName(),c.getLocalParameters()); } int index = 0; for (Map.Entry<Class, Set<ITestNGMethod>> entry : methodsMap.entrySet()) { Class clazz = entry.getKey(); Set<ITestNGMethod> methodList = entry.getValue(); XmlClass xmlClass = new XmlClass(clazz.getName(), index++, false ); List<XmlInclude> methodNames = Lists.newArrayList(methodList.size()); int ind = 0; for (ITestNGMethod m : methodList) { XmlInclude methodName = new XmlInclude( m.getConstructorOrMethod().getName(), m.getFailedInvocationNumbers(), ind++); methodName.setParameters(findMethodLocalParameters(srcXmlTest, m)); methodNames.add(methodName); } xmlClass.setIncludedMethods(methodNames); xmlClass.setParameters(classParameters.get(xmlClass.getName())); result.add(xmlClass); } return result; }

Target:
private List<XmlClass> createXmlClasses(List<ITestNGMethod> methods, XmlTest srcXmlTest) { List<XmlClass> result = Lists.newArrayList(); Map<Class, Set<ITestNGMethod>> methodsMap = Maps.newHashMap(); for (ITestNGMethod m : methods) { Object instances = m.getInstance(); Class clazz = instances == null ? m.getRealClass() : instances.getClass(); Set<ITestNGMethod> methodList = methodsMap.get(clazz); if (null == methodList) { methodList = Sets.newHashSet(); methodsMap.put(clazz, methodList); } methodList.add(m); } Map<String, Map<String, String>> classParameters = Maps.newHashMap(); for (XmlClass c : srcXmlTest.getClasses()) { classParameters.put(c.getName(),c.getLocalParameters()); } int index = 0; for (Map.Entry<Class, Set<ITestNGMethod>> entry : methodsMap.entrySet()) { Class clazz = entry.getKey(); Set<ITestNGMethod> methodList = entry.getValue(); XmlClass xmlClass = new XmlClass(clazz.getName(), index++, false ); List<XmlInclude> methodNames = Lists.newArrayList(methodList.size()); int ind = 0; for (ITestNGMethod m : methodList) { XmlInclude methodName = new XmlInclude( m.getConstructorOrMethod().getName(), m.getFailedInvocationNumbers(), ind++); methodName.setParameters(findMethodLocalParameters(srcXmlTest, m)); methodNames.add(methodName); } xmlClass.setIncludedMethods(methodNames); xmlClass.setParameters(classParameters.get(xmlClass.getName())); result.add(xmlClass); } return result; }
Source:
public String clearAuditTabMessageId() { this.relatesTo = null; this.messageId = null; if (this.auditRecordList != null && !auditRecordList.isEmpty()) { this.auditRecordList.clear(); } this.auditMessage = ""; this.auditFound = false; return NavigationConstant.AUDIT_SEARCH_PAGE; }

Target:
public String clearAuditTabMessageId() { this.relatesTo = null; this.messageId = null; if (auditRecordList != null) { this.auditRecordList.clear(); } this.auditMessage = ""; this.auditFound = false; return NavigationConstant.AUDIT_SEARCH_PAGE; }
Source:
public static void testRead() throws Exception { ProgressInputStream stream = new ProgressInputStream(IOUtils.toInputStream("test", (String) null)); assertThat(stream.getProgress()).isEqualTo(0); int bytesRead = 0; while (stream.read() >= 0 && bytesRead < 10000) { bytesRead++; } assertThat(bytesRead).isEqualTo(4); assertThat(stream.getProgress()).isEqualTo(4); IOUtils.closeQuietly(stream); }

Target:
public static void testRead() throws Exception { ProgressInputStream stream = new ProgressInputStream(IOUtils.toInputStream("test", "UTF-8")); assertThat(stream.getProgress()).isEqualTo(0); int bytesRead = 0; while (stream.read() >= 0 && bytesRead < 10000) { bytesRead++; } assertThat(bytesRead).isEqualTo(4); assertThat(stream.getProgress()).isEqualTo(4); IOUtils.closeQuietly(stream); }
Source:
private static String getSchedulerVersion() { Properties properties = FileUtils.resolvePropertiesFile(GRADLE_PROPERTIES_PATH); String version = properties.getProperty(VERSION_ATTRIBUTE_NAME); return version == null ? "not found" : version; }

Target:
private static String getSchedulerVersion() { return FileUtils.resolvePropertiesFile(GRADLE_PROPERTIES_PATH).getProperty(VERSION_ATTRIBUTE_NAME, "not found"); }
Source:
public void removeMember(PerunSession sess, Group group, Member member) throws InternalErrorException, MemberNotExistsException, NotGroupMemberException, PrivilegeException, GroupNotExistsException, WrongAttributeAssignmentException, AttributeNotExistsException, ExternalyManagedException { Utils.checkPerunSession(sess); getGroupsManagerBl().checkGroupExists(sess, group); getPerunBl().getMembersManagerBl().checkMemberExists(sess, member); Attribute attrSynchronizeEnabled = getPerunBl().getAttributesManagerBl().getAttribute(sess, group, GROUPSYNCHROENABLED_ATTRNAME); if (attrSynchronizeEnabled.getValue() != null) { String synchronizeEnabled = (String) attrSynchronizeEnabled.getValue(); if (synchronizeEnabled.equals("true")) { throw new ExternalyManagedException("Removing of member is not allowed. Group is externaly managed."); } } if (!AuthzResolver.isAuthorized(sess, Role.VOADMIN, group) && !AuthzResolver.isAuthorized(sess, Role.GROUPADMIN, group)) { throw new PrivilegeException(sess, "removeMember"); } getGroupsManagerBl().removeMember(sess, group, member); }

Target:
public void removeMember(PerunSession sess, Group group, Member member) throws InternalErrorException, MemberNotExistsException, NotGroupMemberException, PrivilegeException, GroupNotExistsException, WrongAttributeAssignmentException, AttributeNotExistsException, ExternallyManagedException { Utils.checkPerunSession(sess); getGroupsManagerBl().checkGroupExists(sess, group); getPerunBl().getMembersManagerBl().checkMemberExists(sess, member); if (!AuthzResolver.isAuthorized(sess, Role.VOADMIN, group) && !AuthzResolver.isAuthorized(sess, Role.GROUPADMIN, group)) { throw new PrivilegeException(sess, "removeMember"); } Attribute attrSynchronizeEnabled = getPerunBl().getAttributesManagerBl().getAttribute(sess, group, GROUPSYNCHROENABLED_ATTRNAME); if (Objects.equals("true", (String) attrSynchronizeEnabled.getValue())) { throw new ExternallyManagedException("Removing of member is not allowed. Group is externally managed."); } getGroupsManagerBl().removeMember(sess, group, member); }
Source:
protected HttpURLConnection setupConnection(URL builtUrl) throws IOException { Log.d(TAG, builtUrl.toString()); HttpURLConnection httpConnection = (HttpURLConnection)builtUrl.openConnection(); if (isPostRequest) { setupConnectionInner(httpConnection); httpConnection.setRequestMethod("POST"); httpConnection.setDoOutput(true); buildPostPayload(httpConnection); } else { setupConnectionInner(httpConnection); httpConnection.setRequestMethod("GET"); } return httpConnection; }

Target:
protected HttpURLConnection setupConnection(URL builtUrl) throws IOException { Log.d(TAG, builtUrl.toString()); HttpURLConnection httpConnection = (HttpURLConnection)builtUrl.openConnection(); setupConnectionInner(httpConnection); if (isPostRequest) { httpConnection.setRequestMethod("POST"); httpConnection.setDoOutput(true); buildPostPayload(httpConnection); } else { httpConnection.setRequestMethod("GET"); } return httpConnection; }
Source:
public static String[] getStringValuesFromDatabase(Connection dbConnection, String sqlStmt, Object... params) throws UserStoreException { String[] values = new String[0]; try (PreparedStatement prepStmt = dbConnection.prepareStatement(sqlStmt)) { if (params != null && params.length > 0) { for (int i = 0; i < params.length; i++) { Object param = params[i]; if (param == null) { prepStmt.setString(i + 1, null); } else if (param instanceof String) { prepStmt.setString(i + 1, (String) param); } else if (param instanceof Integer) { prepStmt.setInt(i + 1, (Integer) param); } } } try(ResultSet rs = prepStmt.executeQuery() ) { List<String> lst = new ArrayList<String>(); while (rs.next()) { String name = rs.getString(1); lst.add(name); } if (lst.size() > 0) { values = lst.toArray(new String[lst.size()]); } return values; } } catch (SQLException e) { String errorMessage = "Using sql : " + sqlStmt + " " + e.getMessage(); if (log.isDebugEnabled()) { log.debug(errorMessage, e); } throw new UserStoreException(errorMessage, e); } }

Target:
public static String[] getStringValuesFromDatabase(Connection dbConnection, String sqlStmt, Object... params) throws UserStoreException { String[] values = new String[0]; try (PreparedStatement prepStmt = dbConnection.prepareStatement(sqlStmt)) { if (params != null && params.length > 0) { for (int i = 0; i < params.length; i++) { Object param = params[i]; if (param == null) { prepStmt.setString(i + 1, null); } else if (param instanceof String) { prepStmt.setString(i + 1, (String) param); } else if (param instanceof Integer) { prepStmt.setInt(i + 1, (Integer) param); } } } try(ResultSet rs = prepStmt.executeQuery() ) { List<String> lst = new ArrayList<String>(); while (rs.next()) { String name = rs.getString(1); lst.add(name); } if (lst.size() > 0) { values = lst.toArray(new String[lst.size()]); } return values; } } catch (SQLException e) { String errorMessage = "Using sql : " + sqlStmt + " " + e.getMessage(); if (log.isDebugEnabled()) { log.debug(errorMessage, e); } throw new UserStoreException(errorMessage, e); }finally { close(dbConnection); } }
Source:
public void returnsCorrectLengthWithStream() throws Exception { final byte[] bytes = new Utf8String("Stream returnsCorrectLength!").asBytes(); MatcherAssert.assertThat( "Stream doesn't provide correct number of bytes", new LengthOf( new Body.Stream(new InputOf(bytes).stream()) ).intValue(), new IsEqual<>(bytes.length) ); }

Target:
public void returnsCorrectLengthWithStream() throws Exception { final byte[] bytes = new Utf8String("Stream returnsCorrectLength!").asBytes(); MatcherAssert.assertThat( "Body content of Body.Stream doesn't have the correct length", new LengthOf( new Body.Stream(new InputOf(bytes).stream()) ).intValue(), new IsEqual<>(bytes.length) ); }
Source:
public boolean vdsUpEvent(final VDS vds) { HostStoragePoolParametersBase params = new HostStoragePoolParametersBase(vds); boolean isSucceeded = Backend.getInstance().runInternalAction(VdcActionType.InitVdsOnUp, params).getSucceeded(); if (isSucceeded) { ThreadPoolUtil.execute(new Runnable() { @Override public void run() { try { List<VmStatic> vmsToMigrate = DbFacade.getInstance().getVmStaticDao().getAllWithFailbackByVds(vds.getId()); if (!vmsToMigrate.isEmpty()) { CommandContext ctx = new CommandContext(new EngineContext()); ctx.getExecutionContext().setMonitored(true); Backend.getInstance().runInternalMultipleActions(VdcActionType.MigrateVmToServer, new ArrayList<>(createMigrateVmToServerParametersList(vmsToMigrate, vds)), ctx); } } catch (RuntimeException e) { log.error("Failed to initialize Vds on up: {}", e.getMessage()); log.debug("Exception", e); } } }); } return isSucceeded; }

Target:
public boolean vdsUpEvent(final VDS vds) { HostStoragePoolParametersBase params = new HostStoragePoolParametersBase(vds); boolean isSucceeded = Backend.getInstance().runInternalAction(VdcActionType.InitVdsOnUp, params).getSucceeded(); if (isSucceeded) { ThreadPoolUtil.execute(new Runnable() { @Override public void run() { try { List<VmStatic> vmsToMigrate = DbFacade.getInstance().getVmStaticDao().getAllWithFailbackByVds(vds.getId()); if (!vmsToMigrate.isEmpty()) { CommandContext ctx = new CommandContext(new EngineContext()); ctx.getExecutionContext().setMonitored(true); Backend.getInstance().runInternalMultipleActions(VdcActionType.MigrateVmToServer, new ArrayList<>(createMigrateVmToServerParametersList(vmsToMigrate, vds)), ctx); } } catch (RuntimeException e) { log.error("Failed to initialize Vds on up: {}", e.getMessage()); log.error("Exception", e); } } }); } return isSucceeded; }
Source:
private void stop() { notifier.removeListener(cleanupService); cm.removeListener(cleanupService); cleanupService.stop(); shutDownGracefully(); }

Target:
private void stop() { notifier.removeListener(cleanupService); cm.removeListener(cleanupService); cm.removeListener(this); shutDownGracefully(); }
Source:
public void testDescriptionInclusion() throws Exception { final String xml = "src/test/resources/xml/simple-suite-with-method-desc.xml"; SuiteXmlParser parser = new SuiteXmlParser(); TestNGContentHandler handler = new TestNGContentHandler(xml, false); parser.parse(new FileInputStream(xml), handler); List<XmlInclude> includes = handler.getSuite().getTests().get(0).getXmlClasses().get(0).getIncludedMethods(); String desc = includes.get(0).getDescription(); Assert.assertEquals("simple-description", desc); }

Target:
public void testDescriptionInclusion() throws Exception { final String xml = getPathToResource("xml/simple-suite-with-method-desc.xml"); SuiteXmlParser parser = new SuiteXmlParser(); TestNGContentHandler handler = new TestNGContentHandler(xml, false); parser.parse(new FileInputStream(xml), handler); List<XmlInclude> includes = handler.getSuite().getTests().get(0).getXmlClasses().get(0).getIncludedMethods(); String desc = includes.get(0).getDescription(); Assert.assertEquals("simple-description", desc); }
Source:
public void saveDeposits(final LotDepositRequestDto lotDepositRequestDto, final TransactionStatus transactionStatus) { final WorkbenchUser user = this.securityService.getCurrentlyLoggedInUser(); if (lotDepositRequestDto.getSourceStudy() != null) { this.studyValidator.validate(lotDepositRequestDto.getSourceStudy(), false); } this.lotDepositRequestDtoValidator.validate(lotDepositRequestDto); final LotsSearchDto searchDTO = this.searchRequestDtoResolver.getLotsSearchDto(lotDepositRequestDto.getSelectedLots()); final List<ExtendedLotDto> lotDtos = this.lotService.searchLots(searchDTO, null); this.extendedLotListValidator.validateAllProvidedLotUUIDsExist(lotDtos, lotDepositRequestDto.getSelectedLots().getItemIds()); this.extendedLotListValidator.validateEmptyList(lotDtos); this.extendedLotListValidator.validateEmptyUnits(lotDtos); this.extendedLotListValidator.validateClosedLots(lotDtos); this.lotDepositRequestDtoValidator.validateDepositInstructionsUnits(lotDepositRequestDto, lotDtos); this.transactionService .depositLots(user.getUserid(), lotDtos.stream().map(ExtendedLotDto::getLotId).collect(Collectors.toSet()), lotDepositRequestDto, transactionStatus); }

Target:
public void saveDeposits(final LotDepositRequestDto lotDepositRequestDto, final TransactionStatus transactionStatus) { final WorkbenchUser user = this.securityService.getCurrentlyLoggedInUser(); if (lotDepositRequestDto.getSourceStudyId() != null) { this.studyValidator.validate(lotDepositRequestDto.getSourceStudyId(), true); } this.lotDepositRequestDtoValidator.validate(lotDepositRequestDto); final LotsSearchDto searchDTO = this.searchRequestDtoResolver.getLotsSearchDto(lotDepositRequestDto.getSelectedLots()); final List<ExtendedLotDto> lotDtos = this.lotService.searchLots(searchDTO, null); this.extendedLotListValidator.validateAllProvidedLotUUIDsExist(lotDtos, lotDepositRequestDto.getSelectedLots().getItemIds()); this.extendedLotListValidator.validateEmptyList(lotDtos); this.extendedLotListValidator.validateEmptyUnits(lotDtos); this.extendedLotListValidator.validateClosedLots(lotDtos); this.lotDepositRequestDtoValidator.validateDepositInstructionsUnits(lotDepositRequestDto, lotDtos); this.transactionService .depositLots(user.getUserid(), lotDtos.stream().map(ExtendedLotDto::getLotId).collect(Collectors.toSet()), lotDepositRequestDto, transactionStatus); }
Source:
private CloseableHttpClient buildHttpClient() { try { final SSLContext sslContext = SSLContext.getInstance("TLSv1.2"); sslContext.init(null, null, null); final SSLConnectionSocketFactory sslSocketFactory = new SSLConnectionSocketFactory( sslContext, HostnameVerifier.INSTANCE); return HttpClients.custom() .setSSLSocketFactory(sslSocketFactory) .setDefaultRequestConfig(RequestConfig.custom() .setConnectTimeout(mBuilder.mConnectionTimeoutInMillis) .build()) .setDefaultSocketConfig(SocketConfig.custom() .setSoTimeout(mBuilder.mSocketTimeoutInMillis) .build()) .build(); } catch (final KeyManagementException e) { throw new RuntimeException("Exception while building Apache http client", e); } catch (final NoSuchAlgorithmException e) { throw new RuntimeException("Exception while building Apache http client", e); } }

Target:
private CloseableHttpClient buildHttpClient() { try { final SSLContext sslContext = SSLContext.getInstance("TLSv1.2"); sslContext.init(null, new X509ExtendedTrustManager[] { new HostnameVerifyingX509ExtendedTrustManager(true)}, new SecureRandom()); final SSLConnectionSocketFactory sslSocketFactory = new SSLConnectionSocketFactory(sslContext); return HttpClients.custom() .setSSLSocketFactory(sslSocketFactory) .setDefaultRequestConfig(RequestConfig.custom() .setConnectTimeout(mBuilder.mConnectionTimeoutInMillis) .build()) .setDefaultSocketConfig(SocketConfig.custom() .setSoTimeout(mBuilder.mSocketTimeoutInMillis) .build()) .build(); } catch (final KeyManagementException e) { throw new RuntimeException("Exception while building Apache http client", e); } catch (final NoSuchAlgorithmException e) { throw new RuntimeException("Exception while building Apache http client", e); } }
Source:
public void execute() throws IOException { executeInternal(); }

Target:
public HttpConnection execute() throws IOException { System.setProperty("http.keepAlive", "false"); connection = (HttpURLConnection) url.openConnection(); for (String key : requestProperties.keySet()) { connection.setRequestProperty(key, requestProperties.get(key)); } connection.setDoInput(true); connection.setRequestMethod(requestMethod); if (contentType != null) { connection.setRequestProperty("Content-type", contentType); } if (url.getUserInfo() != null) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); OutputStream bos = Base64OutputStreamFactory.get(baos); bos.write(url.getUserInfo().getBytes()); bos.flush(); bos.close(); String encodedAuth = baos.toString(); connection.setRequestProperty("Authorization", String.format("Basic %s", encodedAuth)); } if (input != null) { connection.setDoOutput(true); if (inputLength != -1) { connection.setFixedLengthStreamingMode((int)this.inputLength); } else { connection.setChunkedStreamingMode(1024); } connection.setRequestProperty("Expect", "100-continue"); int bufSize = 1024; int nRead = 0; byte[] buf = new byte[bufSize]; InputStream is = input; OutputStream os = connection.getOutputStream(); while((nRead = is.read(buf)) >= 0) { os.write(buf, 0, nRead); } os.flush(); } return this; }
Source:
private MostRecentObserver(T value) { VALUE_UPDATER.lazySet(this, nl.next(value)); }

Target:
private MostRecentObserver(T value) { this.value = nl.next(value); }
Source:
public void setEnvironment() throws Exception { super.init(userMode); String gatewayUrl; if (gatewayContextWrk.getContextTenant().getDomain().equals(MultitenantConstants.SUPER_TENANT_DOMAIN_NAME)) { gatewayUrl = gatewayUrlsWrk.getWebAppURLNhttp(); } else { gatewayUrl = gatewayUrlsWrk.getWebAppURLNhttp() + "t/" + gatewayContextWrk.getContextTenant().getDomain() + "/"; } apiEndPointUrl = gatewayUrl + "jaxrs_basic/services/customers/customerservice"; apiProvider = publisherContext.getContextTenant().getContextUser().getUserName(); }

Target:
public void setEnvironment() throws Exception { super.init(userMode); String gatewayUrl; if (MultitenantConstants.SUPER_TENANT_DOMAIN_NAME.equals(gatewayContextWrk.getContextTenant().getDomain())) { gatewayUrl = gatewayUrlsWrk.getWebAppURLNhttp(); } else { gatewayUrl = gatewayUrlsWrk.getWebAppURLNhttp() + "t/" + gatewayContextWrk.getContextTenant().getDomain() + "/"; } apiEndPointUrl = gatewayUrl + "jaxrs_basic/services/customers/customerservice"; apiProvider = publisherContext.getContextTenant().getContextUser().getUserName(); }
Source:
public Journal getJournal(String journalKey) { Journal journal = hibernateTemplate.execute(session -> { Query query = session.createQuery("" + "FROM Journal j " + "WHERE j.journalKey = :journalKey "); query.setParameter("journalKey", journalKey); return (Journal) query.uniqueResult(); }); if (journal == null) { throw new RestClientException(journalNotFoundMessage(journalKey), HttpStatus.NOT_FOUND); } return journal; }

Target:
public Journal getJournal(String journalKey) { Journal journal = hibernateTemplate.execute(session -> { Query query = session.createQuery("FROM Journal j WHERE j.journalKey = :journalKey "); query.setParameter("journalKey", journalKey); return (Journal) query.uniqueResult(); }); if (journal == null) { throw new RestClientException(journalNotFoundMessage(journalKey), HttpStatus.NOT_FOUND); } return journal; }
Source:
public void retrieveSubjectToken() throws IOException { MockExternalAccountCredentialsTransportFactory transportFactory = new MockExternalAccountCredentialsTransportFactory(); AwsCredentials awsCredential = (AwsCredentials) AwsCredentials.newBuilder(AWS_CREDENTIAL) .setHttpTransportFactory(transportFactory) .setCredentialSource(buildAwsCredentialSource(transportFactory)) .build(); String subjectToken = awsCredential.retrieveSubjectToken(); JsonParser parser = OAuth2Utils.JSON_FACTORY.createJsonParser(subjectToken); GenericJson json = parser.parseAndClose(GenericJson.class); Map<String, String> headers = (Map<String, String>) json.get("headers"); assertThat(json.get("method")).isEqualTo("POST"); assertThat(json.get("url")).isEqualTo(GET_CALLER_IDENTITY_URL); assertThat(headers.get("host")).isEqualTo(URI.create(GET_CALLER_IDENTITY_URL).getHost()); assertThat(headers.containsKey("x-amz-date")).isTrue(); assertThat(headers.get("x-amz-security-token")).isEqualTo("token"); assertThat(headers.get("x-goog-cloud-target-resource")).isEqualTo(awsCredential.getAudience()); assertThat(headers.get("Authorization")).isNotNull(); }

Target:
public void retrieveSubjectToken() throws IOException { MockExternalAccountCredentialsTransportFactory transportFactory = new MockExternalAccountCredentialsTransportFactory(); AwsCredentials awsCredential = (AwsCredentials) AwsCredentials.newBuilder(AWS_CREDENTIAL) .setHttpTransportFactory(transportFactory) .setCredentialSource(buildAwsCredentialSource(transportFactory)) .build(); String subjectToken = awsCredential.retrieveSubjectToken(); JsonParser parser = OAuth2Utils.JSON_FACTORY.createJsonParser(subjectToken); GenericJson json = parser.parseAndClose(GenericJson.class); Map<String, String> headers = (Map<String, String>) json.get("headers"); assertEquals("POST", json.get("method")); assertEquals(GET_CALLER_IDENTITY_URL, json.get("url")); assertEquals(URI.create(GET_CALLER_IDENTITY_URL).getHost(), headers.get("host")); assertEquals("token", headers.get("x-amz-security-token")); assertEquals(awsCredential.getAudience(), headers.get("x-goog-cloud-target-resource")); assertTrue(headers.containsKey("x-amz-date")); assertNotNull(headers.get("Authorization")); }
Source:
public void aggregate(ByteBuffer buf, int position) { final int oldPosition = buf.position(); buf.position(position); bufferAdd(buf); buf.position(oldPosition); }

Target:
public void aggregate(ByteBuffer buf, int position) { final int oldPosition = buf.position(); try { buf.position(position); bufferAdd(buf); } finally { buf.position(oldPosition); } }
Source:
Map<String, RedisPatchSchedule> patchSchedulesAsMap() { if (!load) { load = true; cacheCollection(); } Map<String, RedisPatchSchedule> result = new HashMap<>(); for (Map.Entry<String, RedisPatchScheduleImpl> entry : this.collection().entrySet()) { RedisPatchScheduleImpl patchSchedule = entry.getValue(); result.put(entry.getKey(), patchSchedule); } return Collections.unmodifiableMap(result); }

Target:
Map<String, RedisPatchSchedule> patchSchedulesAsMap() { ensureCollectionLoaded(); Map<String, RedisPatchSchedule> result = new HashMap<>(); for (Map.Entry<String, RedisPatchScheduleImpl> entry : this.collection().entrySet()) { RedisPatchScheduleImpl patchSchedule = entry.getValue(); result.put(entry.getKey(), patchSchedule); } return Collections.unmodifiableMap(result); }
Source:
@Override public void updateMvccCandidatesWithCurrentThread(long oldThreadId) { long currentThreadId = Thread.currentThread().getId(); for (IgniteTxEntry igniteTxEntry : txMap.values()) { GridCacheEntryEx cached = igniteTxEntry.cached(); if (cached != null && !cached.obsolete()) { GridCacheMvccCandidate candidate = null; try { candidate = cached.localCandidate(oldThreadId); } catch (GridCacheEntryRemovedException ignore) { assert false; } if (candidate != null) candidate.setThreadId(currentThreadId); } } }

Target:
@Override public void updateMvccCandidatesWithCurrentThread(long oldThreadId) { long curThreadId = Thread.currentThread().getId(); for (IgniteTxEntry entry : txMap.values()) { GridCacheEntryEx cached = entry.cached(); if (cached != null && !cached.obsolete()) { GridCacheMvccCandidate candidate = null; try { candidate = cached.localCandidate(oldThreadId); } catch (GridCacheEntryRemovedException e) { assert false; } if (candidate != null) candidate.threadId(curThreadId); } } }
Source:
public S3BatchSource(S3BatchConfig config) { super(new FileBatchConfig(config.referenceName, config.fileRegex, config.timeTable, config.inputFormatClass, config.fileSystemProperties, config.maxSplitSize, config.ignoreNonExistingFolders, config.recursive, config.path, config.pathField, config.filenameOnly, config.schema)); this.config = config; }

Target:
public S3BatchSource(S3BatchConfig config) { super(config); this.config = config; }