auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void processPMMLImport(DMNModelImpl model, Import i) { URI pmmlURI = null; try { pmmlURI = resolveRelativeURI(model, i.getLocationURI()); } catch (Exception e) { logger.warn("Error inspecting the imported PMML model", e); } if (pmmlURI == null) { return; } InputStream pmmlIS = null; try { pmmlIS = pmmlURI.isAbsolute() ? pmmlURI.toURL().openStream() : ((DMNCompilerConfigurationImpl) dmnCompilerConfig).getRootClassLoader().getResourceAsStream(pmmlURI.toString()); } catch (IOException e) { logger.warn("Error inspecting the imported PMML model", e); } <START> Either<Exception, DMNImportPMMLInfo> pmml = DMNImportPMMLInfo.from(pmmlIS, model, i).cata(x -> { <END> logger.warn("Error inspecting the imported PMML model", x); return null; }, x -> { model.addPMMLImportInfo(x); return null; }); }</code><technical_language>@tarilabs cool stuff. I this up. However, I wondering Either<Exception, DMNImportPMMLInfo> pmml local variable all. For clarity I suppose</technical_language>

Target:
private void processPMMLImport(DMNModelImpl model, Import i) { URL pmmlURL = pmmlImportURL(((DMNCompilerConfigurationImpl) dmnCompilerConfig).getRootClassLoader(), model, i, i); if (pmmlURL == null) { return; } try (InputStream pmmlIS = pmmlURL.openStream();) { DMNImportPMMLInfo.from(pmmlIS, model, i).consume(x -> new PMMLImportErrConsumer(model, i), model::addPMMLImportInfo); } catch (IOException e) { new PMMLImportErrConsumer(model, i).accept(e); } }
Source:
<code>public ClientBuilder disableSSLAuthentication() { if(authenticatedModeSSLSocketFactory == null) { this.isSSLAuthenticationDisabled = true; } else { <START> throw new IllegalStateException("SSLSocketFactory is not null. Please " + <END> "create a ClientBuilder without a custom SSLSocketFactory."); } return this; }</code><technical_language>I this message more helpful user, internal implementation is a null. like: throw new IllegalStateException("Cannot disable SSL authentication a custom SSLSocketFactory set")</technical_language>

Target:
public ClientBuilder disableSSLAuthentication() { if(authenticatedModeSSLSocketFactory == null) { this.isSSLAuthenticationDisabled = true; } else { throw new IllegalStateException("Cannot disable SSL authentication when a " + "custom SSLSocketFactory has been set."); } return this; }
Source:
<code>private void copySaveDirectoryToRecordingLibrary(String gameTitle) { File saveDirectory = new File(PathManager.getInstance().getSavePath(gameTitle).toString()); Path destinationPath = PathManager.getInstance().getRecordingPath(gameTitle); File destDirectory = new File(destinationPath.toString()); try { FileUtils.copyDirectoryStructure(saveDirectory, destDirectory); } catch (Exception e) { <START> logger.error(e.getMessage()); <END> } }</code><technical_language>log full exception</technical_language>

Target:
private void copySaveDirectoryToRecordingLibrary(String gameTitle) { File saveDirectory = new File(PathManager.getInstance().getSavePath(gameTitle).toString()); Path destinationPath = PathManager.getInstance().getRecordingPath(gameTitle); File destDirectory = new File(destinationPath.toString()); try { FileUtils.copyDirectoryStructure(saveDirectory, destDirectory); } catch (Exception e) { logger.error("Error trying to copy the save directory:", e); } }
Source:
<code>public Definition addProgramModule(Definition d) { <START> Module programsModule = gen.getProgramsGrammar(d.mainSyntaxModule()).module(); <END> java.util.Set<Module> allModules = mutable(d.modules()); allModules.add(programsModule); return Definition(d.mainModule(), programsModule, immutable(allModules)); }</code><technical_language>again, of this is necessary I tell</technical_language>

Target:
public Definition addProgramModule(Definition d) { Module programsModule = gen.getProgramsGrammar(d.mainSyntaxModule()); java.util.Set<Module> allModules = mutable(d.modules()); allModules.add(programsModule); return Definition(d.mainModule(), programsModule, immutable(allModules)); }
Source:
<code>private static CommandLine parseArgs(String[] args) { Options options = new Options(); options.addOption("p", "port", true, "Zookeeper port number to use"); options.addOption("l", "logDir", true, "Zookeeper logDir"); options.addOption("s", "snapshotDir", true, "Zookeeper snapshotDir"); CommandLineParser parser = new BasicParser(); CommandLine commandLine; try { commandLine = parser.parse(options, args); } catch (Exception e) { commandLine = null; LOG.error(e.getMessage()); HelpFormatter formatter = new HelpFormatter(); <START> formatter.printHelp("EmbeddedZookeeper", "Start EmbeddedZookeeper for testing.", options, "go/datastream", true); <END> } return commandLine; }</code><technical_language>go/datastream is visible LinkedIn. remove reference</technical_language>

Target:
private static CommandLine parseArgs(String[] args) { Options options = new Options(); options.addOption("p", "port", true, "Zookeeper port number to use"); options.addOption("l", "logDir", true, "Zookeeper logDir"); options.addOption("s", "snapshotDir", true, "Zookeeper snapshotDir"); CommandLineParser parser = new BasicParser(); CommandLine commandLine; try { commandLine = parser.parse(options, args); } catch (Exception e) { commandLine = null; LOG.error(e.getMessage()); } return commandLine; }
Source:
<code>private void checkResourceAccessible(Long accountId, Long domainId, String exceptionMessage) { Account caller = CallContext.current().getCallingAccount(); <START> if ((domainId != null) && (domainId == -1)) <END> { throw new CloudRuntimeException("Invalid DomainId : -1"); } if (accountId != null) { _accountMgr.checkAccess(caller, null, false, _accountMgr.getAccount(accountId)); } else if (domainId != null && !_accountMgr.isNormalUser(caller.getId())) { _accountMgr.checkAccess(caller, _domainMgr.getDomain(domainId)); } else { throw new PermissionDeniedException(exceptionMessage); } }</code><technical_language>java.util.Objects.equals(Object, Object) here? do need this domainId != null</technical_language>

Target:
private void checkResourceAccessible(Long accountId, Long domainId, String exceptionMessage) { Account caller = CallContext.current().getCallingAccount(); if (Objects.equals(domainId, -1)) { throw new CloudRuntimeException("Invalid DomainId: -1"); } if (accountId != null) { _accountMgr.checkAccess(caller, null, false, _accountMgr.getAccount(accountId)); } else if (domainId != null && !_accountMgr.isNormalUser(caller.getId())) { _accountMgr.checkAccess(caller, _domainMgr.getDomain(domainId)); } else { throw new PermissionDeniedException(exceptionMessage); } }
Source:
<code>public MockMethodInvocation(Object targetObject, Class clazz, String methodName, Class[] parameterTypes, Object[] arguments) throws NoSuchMethodException { <START> this.method = clazz.getMethod(methodName, parameterTypes); <END> this.targetObject = targetObject; this.arguments = arguments; }</code><technical_language>Is reason calling this(targetObject, clazz, methodName, parameterTypes)? If not, mind changing this? I realize a minor point, track off</technical_language>

Target:
public MockMethodInvocation(Object targetObject, Class clazz, String methodName, Class[] parameterTypes, Object[] arguments) throws NoSuchMethodException { this(targetObject, clazz, methodName, parameterTypes); this.arguments = arguments; }
Source:
<code>public static ReplicationPeerConfig updateReplicationBasePeerConfigs(Configuration conf, ReplicationPeerConfig receivedPeerConfig) { String removeBasePeerConfigs = conf.get(HBASE_REPLICATION_PEER_REMOVE_BASE_CONFIG, ""); ReplicationPeerConfigBuilder copiedPeerConfigBuilder = ReplicationPeerConfig. newBuilder(receivedPeerConfig); if (removeBasePeerConfigs.length() != 0) { List<String> removeBasePeerConfigList = Splitter.on(';').trimResults() .omitEmptyStrings().splitToList(removeBasePeerConfigs); for (String peerConfigToRemove : removeBasePeerConfigList) { copiedPeerConfigBuilder.removeConfiguration(peerConfigToRemove); } } Map<String, String> receivedPeerConfigMap = receivedPeerConfig.getConfiguration(); <START> String basePeerConfigs = conf.get(HBASE_REPLICATION_PEER_BASE_CONFIG, ""); <END> if (basePeerConfigs.length() != 0) { Map<String, String> basePeerConfigMap = Splitter.on(';').trimResults().omitEmptyStrings() .withKeyValueSeparator("=").split(basePeerConfigs); for (Map.Entry<String, String> entry : basePeerConfigMap.entrySet()) { String configName = entry.getKey(); String configValue = entry.getValue(); if (!receivedPeerConfigMap.getOrDefault(configName, "").equals(configValue)) { copiedPeerConfigBuilder.putConfiguration(configName, configValue); } } } return copiedPeerConfigBuilder.build(); }</code><technical_language>if I try add a peer config setting remove peer config setting in Configuration object? add silently wins? produce exception (or a log)</technical_language>

Target:
public static ReplicationPeerConfig updateReplicationBasePeerConfigs(Configuration conf, ReplicationPeerConfig receivedPeerConfig) { ReplicationPeerConfigBuilder copiedPeerConfigBuilder = ReplicationPeerConfig. newBuilder(receivedPeerConfig); Map<String, String> receivedPeerConfigMap = receivedPeerConfig.getConfiguration(); String basePeerConfigs = conf.get(HBASE_REPLICATION_PEER_BASE_CONFIG, ""); if (basePeerConfigs.length() != 0) { Map<String, String> basePeerConfigMap = Splitter.on(';').trimResults().omitEmptyStrings() .withKeyValueSeparator("=").split(basePeerConfigs); for (Map.Entry<String, String> entry : basePeerConfigMap.entrySet()) { String configName = entry.getKey(); String configValue = entry.getValue(); if (Strings.isNullOrEmpty(configValue)) { copiedPeerConfigBuilder.removeConfiguration(configName); } else if (!receivedPeerConfigMap.getOrDefault(configName, "").equals(configValue)) { copiedPeerConfigBuilder.putConfiguration(configName, configValue); } } } return copiedPeerConfigBuilder.build(); }
Source:
<code>public void testHasPublicAccess() throws Exception { <START> when(inheritedAclFactory.getPatronAccess(any(PID.class))).thenReturn(PatronAccess.everyone); <END> filter.filter(dip); verify(idb).setStatus(listCaptor.capture()); assertTrue(listCaptor.getValue().contains(FacetConstants.PUBLIC_ACCESS)); }</code><technical_language>I this is necessary, a valid result getPatronAccess for a folder/work/fileObj. If PatronAccess.parent default for tests care of this case. suggest moving principalRoles.put(AccessPrincipalConstants.PUBLIC_PRINC, new HashSet<String>()); init method this test affecting other unrelated tests</technical_language>

Target:
public void testHasPublicAccess() throws Exception { principalRoles.put(AccessPrincipalConstants.PUBLIC_PRINC, new HashSet<String>()); when(inheritedAclFactory.getPrincipalRoles(any(PID.class))).thenReturn(principalRoles); filter.filter(dip); verify(idb).setStatus(listCaptor.capture()); assertTrue(listCaptor.getValue().contains(FacetConstants.PUBLIC_ACCESS)); assertFalse(listCaptor.getValue().contains(FacetConstants.STAFF_ONLY_ACCESS)); }
Source:
<code><START> private static String getLoginFilePath() { <END> String loginFile = PASchedulerProperties.SCHEDULER_LOGIN_FILENAME.getValueAsString(); if (!(new File(loginFile).isAbsolute())) { loginFile = PASchedulerProperties.SCHEDULER_HOME.getValueAsString() + File.separator + loginFile; } return loginFile; }</code><technical_language>getLoginFilePath, getGroupFilePath, getPublicKeyFilePath similar, refactored. : private static String getFilePath(String fileType) { if (!(new File(fileType).isAbsolute())) { //file path is relative, complete path prefix Scheduler_Home constant fileType = PASchedulerProperties.SCHEDULER_HOME.getValueAsString() + File.separator + fileType; } return fileType; }</technical_language>

Target:
private static String getLoginFilePath() { return getSchedulerFile(PASchedulerProperties.SCHEDULER_LOGIN_FILENAME.getValueAsString()); }
Source:
<code>public void visitArrayAssignmentPatternElement(ArrayAssignmentPatternElementTree tree) { visitAssignedVariable(tree.variable()); <START> super.visitArrayAssignmentPatternElement(tree); <END> }</code><technical_language>remove this line</technical_language>

Target:
public void visitArrayAssignmentPatternElement(ArrayAssignmentPatternElementTree tree) { if (visitAssignedVariable(tree.variable())) { Tree key = tree.key(); if (key != null) { visitAssignedVariable(key); } } else { super.visitArrayAssignmentPatternElement(tree); } }
Source:
<code>public ListenableFuture<LookupSourceProvider> createLookupSourceProvider() { lock.writeLock().lock(); try { <START> checkState(!destroyed.isDone(), "PartitionedLookupSourceFactory has been destroyed"); <END> if (lookupSourceSupplier != null) { return immediateFuture(new SpillAwareLookupSourceProvider()); } SettableFuture<LookupSourceProvider> lookupSourceFuture = SettableFuture.create(); lookupSourceFutures.add(lookupSourceFuture); return lookupSourceFuture; } finally { lock.writeLock().unlock(); } }</code><technical_language>nit: shorter version more resilient potential future renames suggestion checkState(!destroyed.isDone(), "already destroyed");</technical_language>

Target:
public ListenableFuture<LookupSourceProvider> createLookupSourceProvider() { lock.writeLock().lock(); try { checkState(!destroyed.isDone(), "already destroyed"); if (lookupSourceSupplier != null) { return immediateFuture(new SpillAwareLookupSourceProvider()); } SettableFuture<LookupSourceProvider> lookupSourceFuture = SettableFuture.create(); lookupSourceFutures.add(lookupSourceFuture); return lookupSourceFuture; } finally { lock.writeLock().unlock(); } }
Source:
<code><START> public OperationFuture<LoadBalancerPool> update(LoadBalancerPool loadBalancerPool, LoadBalancerPoolConfig config) { <END> LoadBalancer loadBalancer = config.getLoadBalancer(); loadBalancerPoolClient.update( fetchDataCenterId(loadBalancer.getDataCenter()), fetchLoadBalancerId(loadBalancer), findByRef(loadBalancerPool).getId(), new LoadBalancerPoolRequest() .method(config.getMethod()) .persistence(config.getPersistence()) ); return new OperationFuture<>( loadBalancerPool, new NoWaitingJobFuture() ); }</code><technical_language>please add support for update set of pools? (LoadBalancerPoolFilter, List<LoadBalancerPool>)</technical_language>

Target:
public OperationFuture<LoadBalancerPool> update(LoadBalancerPool loadBalancerPool, LoadBalancerPoolConfig config) { LoadBalancerPoolMetadata loadBalancerPoolMetadata = findByRef(loadBalancerPool); loadBalancerPoolClient.update( loadBalancerPoolMetadata.getDataCenterId(), loadBalancerPoolMetadata.getLoadBalancerId(), loadBalancerPoolMetadata.getId(), new LoadBalancerPoolRequest() .method(config.getMethod()) .persistence(config.getPersistence()) ); return new OperationFuture<>( loadBalancerPool, new NoWaitingJobFuture() ); }
Source:
<code>public void testWithDeclaration() throws Exception { ApplicationXMLFormatter xmlFormatter = new ApplicationXMLFormatter(); MessageContext messageContext = new MessageContext(); messageContext.setProperty("WRITE_XML_DECLARATION", "true"); createPayload(messageContext); OMOutputFormat format = new OMOutputFormat(); format.setCharSetEncoding(StandardCharsets.UTF_8.toString()); ByteArrayOutputStream baos = new ByteArrayOutputStream(); xmlFormatter.writeTo(messageContext, format, baos, true); String output = new String(baos.toByteArray()); <START> assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\" ?><hello>world</hello>", output); <END> }</code><technical_language>Add assert message</technical_language>

Target:
public void testWithDeclaration() throws Exception { ApplicationXMLFormatter xmlFormatter = new ApplicationXMLFormatter(); MessageContext messageContext = new MessageContext(); messageContext.setProperty("WRITE_XML_DECLARATION", "true"); createPayload(messageContext); OMOutputFormat format = new OMOutputFormat(); format.setCharSetEncoding(StandardCharsets.UTF_8.toString()); ByteArrayOutputStream baos = new ByteArrayOutputStream(); xmlFormatter.writeTo(messageContext, format, baos, true); String output = new String(baos.toByteArray()); assertEquals("Compare payload with default XML declaration", "<?xml version=\"1.0\" encoding=\"UTF-8\" ?><hello>world</hello>", output); }
Source:
<code>public static ClientChatMode of(int data) { ClientChatMode mode = dataToMode.get(data); <START> if (mode == null) <END> throw new IllegalArgumentException("no client chat mode with id=" + data); return mode; }</code><technical_language>Please full brackets</technical_language>

Target:
public static ClientChatMode of(int data) { ClientChatMode mode = dataToMode.get(data); if (mode == null) { throw new IllegalArgumentException("no client chat mode with id=" + data); } return mode; }
Source:
<code>public File newFolder(String... paths) throws IOException { File root = getRoot(); for (String path : paths) { if (new File(path).isAbsolute()) { throw new IOException("folder path \'" + path + "\' is not a relative path"); } <START> } <END> File relativePath = null; File file = root; boolean lastMkdirsCallSuccessful = true; for (int i = 0; i < paths.length; i++) { relativePath = relativePath == null ? new File(paths[i]) : new File(relativePath, paths[i]); file = new File(root, relativePath.getPath()); lastMkdirsCallSuccessful = file.mkdirs(); if (!lastMkdirsCallSuccessful && !file.isDirectory()) { throw new IOException( "could not create a folder with the path \'" + relativePath.getPath() + "\'"); } } if (!lastMkdirsCallSuccessful) { throw new IOException( "a folder with the path \'" + relativePath.getPath() + "\' already exists"); } return file; }</code><technical_language>I add a check for paths.length > 0. in case currently return getRoot() a "new fresh folder"</technical_language>

Target:
public File newFolder(String... paths) throws IOException { if (paths.length == 0) { throw new IllegalArgumentException("must pass at least one path"); } File root = getRoot(); for (String path : paths) { if (new File(path).isAbsolute()) { throw new IOException("folder path \'" + path + "\' is not a relative path"); } } File relativePath = null; File file = root; boolean lastMkdirsCallSuccessful = true; for (int i = 0; i < paths.length; i++) { relativePath = new File(relativePath, paths[i]); file = new File(root, relativePath.getPath()); lastMkdirsCallSuccessful = file.mkdirs(); if (!lastMkdirsCallSuccessful && !file.isDirectory()) { throw new IOException( "could not create a folder with the path \'" + relativePath.getPath() + "\'"); } } if (!lastMkdirsCallSuccessful) { throw new IOException( "a folder with the path \'" + relativePath.getPath() + "\' already exists"); } return file; }
Source:
<code>public final void aggregateEndOfStream(EndOfStreamMessage eos, SystemStreamPartition ssp, MessageCollector collector, TaskCoordinator coordinator) { LOG.info("Received end-of-stream message from task in {}", eos.getTaskName(), ssp); eosStates.update(eos, ssp); SystemStream stream = ssp.getSystemStream(); if (eosStates.isEndOfStream(stream)) { LOG.info("Input reaches the end for task {}", stream.toString(), taskName.getTaskName()); <START> if (eos.getTaskName() != null) { <END> controlMessageSender.broadcast(new EndOfStreamMessage(), ssp, collector); } onEndOfStream(collector, coordinator); if (eosStates.allEndOfStream()) { LOG.info("All input streams have reached the end for task {}", taskName.getTaskName()); coordinator.commit(TaskCoordinator.RequestScope.CURRENT_TASK); coordinator.shutdown(TaskCoordinator.RequestScope.CURRENT_TASK); } } }</code><technical_language>I understand this condition? In case task name is null? send broadcast in case is NULL</technical_language>

Target:
public final void aggregateEndOfStream(EndOfStreamMessage eos, SystemStreamPartition ssp, MessageCollector collector, TaskCoordinator coordinator) { LOG.info("Received end-of-stream message from task in {}", eos.getTaskName(), ssp); eosStates.update(eos, ssp); SystemStream stream = ssp.getSystemStream(); if (eosStates.isEndOfStream(stream)) { LOG.info("Input reaches the end for task {}", stream.toString(), taskName.getTaskName()); if (eos.getTaskName() != null) { controlMessageSender.broadcastToOtherPartitions(new EndOfStreamMessage(), ssp, collector); } onEndOfStream(collector, coordinator); if (eosStates.allEndOfStream()) { LOG.info("All input streams have reached the end for task {}", taskName.getTaskName()); coordinator.commit(TaskCoordinator.RequestScope.CURRENT_TASK); coordinator.shutdown(TaskCoordinator.RequestScope.CURRENT_TASK); } } }
Source:
<code>public <T> Match<T> matchWith(WithPattern<T> withPattern, Object object, Captures captures) { Function<? super T, Optional<?>> property = withPattern.getProperty(); <START> Optional<?> propValue = property.apply((T) object); <END> Optional<?> resolvedValue = propValue .map(value -> value instanceof GroupReference ? lookup.resolve(((GroupReference) value)) : value); Match<?> propertyMatch = resolvedValue .map(value -> match(withPattern.getPattern(), value, captures)) .orElse(Match.empty()); return propertyMatch.map(ignored -> (T) object); }</code><technical_language>abbreviate variable names. Rename propertyValue</technical_language>

Target:
public <T> Match<T> matchWith(WithPattern<T> withPattern, Object object, Captures captures) { Function<? super T, Optional<?>> property = withPattern.getProperty(); Optional<?> propertyValue = property.apply((T) object); Optional<?> resolvedValue = propertyValue .map(value -> value instanceof GroupReference ? lookup.resolve(((GroupReference) value)) : value); Match<?> propertyMatch = resolvedValue .map(value -> match(withPattern.getPattern(), value, captures)) .orElse(Match.empty()); return propertyMatch.map(ignored -> (T) object); }
Source:
<code>private void verifyHBound(H h) { <START> Truth.assertThat(h.button1).isNotNull(); <END> Truth.assertThat(h.button2).isNotNull(); Truth.assertThat(h.button3).isNotNull(); }</code><technical_language>static import</technical_language>

Target:
private void verifyHBound(H h) { assertThat(h.button1).isNotNull(); assertThat(h.button2).isNotNull(); assertThat(h.button3).isNotNull(); }
Source:
<code>private JavaRDD<AffMatchResult> doMatch(JavaSparkContext sc, JavaRDD<AffMatchAffiliation> normalizedAffiliations, JavaRDD<AffMatchOrganization> normalizedOrganizations) { JavaPairRDD<String, AffMatchResult> allMatchedAffOrgsWithKey = sc.parallelizePairs(new ArrayList<>()); for (AffOrgMatcher affOrgMatcher : affOrgMatchers) { JavaRDD<AffMatchResult> matchedAffOrgs = affOrgMatcher.match(normalizedAffiliations, normalizedOrganizations); JavaPairRDD<String, AffMatchResult> matchedAffOrgsWithKey = matchedAffOrgs <START> .keyBy(x -> x.getAffiliation().getId() + AFF_ORG_ID_SEPARATOR + x.getOrganization().getId()); <END> allMatchedAffOrgsWithKey = allMatchedAffOrgsWithKey.union(matchedAffOrgsWithKey); } JavaRDD<AffMatchResult> allMatchedAffOrgs = allMatchedAffOrgsWithKey .reduceByKey((r1, r2) -> affMatchResultChooser.chooseBetter(r1, r2)) .values(); return allMatchedAffOrgs; }</code><technical_language>I Tuple2<String, String> key</technical_language>

Target:
private JavaRDD<AffMatchResult> doMatch(JavaSparkContext sc, JavaRDD<AffMatchAffiliation> normalizedAffiliations, JavaRDD<AffMatchOrganization> normalizedOrganizations) { JavaPairRDD<Tuple2<String, String>, AffMatchResult> allMatchedAffOrgsWithKey = sc.parallelizePairs(new ArrayList<>()); for (AffOrgMatcher affOrgMatcher : affOrgMatchers) { JavaRDD<AffMatchResult> matchedAffOrgs = affOrgMatcher.match(normalizedAffiliations, normalizedOrganizations); JavaPairRDD<Tuple2<String, String>, AffMatchResult> matchedAffOrgsWithKey = matchedAffOrgs .keyBy(x -> new Tuple2<>(x.getAffiliation().getId(), x.getOrganization().getId())); allMatchedAffOrgsWithKey = allMatchedAffOrgsWithKey.union(matchedAffOrgsWithKey); } JavaRDD<AffMatchResult> allMatchedAffOrgs = allMatchedAffOrgsWithKey .reduceByKey((r1, r2) -> affMatchResultChooser.chooseBetter(r1, r2)) .values(); return allMatchedAffOrgs; }
Source:
<code>private void send(final Iterable<String> xemblies) throws IOException { <START> final StringBuilder bodyBuilder = <END> new StringBuilder("Action=SendMessageBatch&Version=2011-10-01&"); final List<String> postMessages = new ArrayList<String>(); final List<String> messages = this.jsonMessages(xemblies); for (int identifier = 0; identifier < messages.size(); ++identifier) { postMessages.add( String.format( "SendMessageBatchRequestEntry.%1$d.Id=%1$d&SendMessageBatchRequestEntry.%1$d.MessageBody=%2$s", identifier + 1, URLEncoder.encode( messages.get(identifier), CharEncoding.UTF_8 ) ) ); } bodyBuilder.append(StringUtils.join(postMessages, '&')); final String body = bodyBuilder.toString(); try { final List<String> idsNotSent = this.queue .header(HttpHeaders.CONTENT_ENCODING, CharEncoding.UTF_8) .header( HttpHeaders.CONTENT_LENGTH, body.getBytes(CharEncoding.UTF_8).length ) .header( HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_FORM_URLENCODED ) .post( String.format( "sending %d lines to stand SQS queue", messages.size() ), body ) .assertStatus(HttpURLConnection.HTTP_OK) .xpath("/SendMessageBatchResponse/BatchResultError/BatchResultErrorEntry/Id/text()"); if ((idsNotSent != null) && !idsNotSent.isEmpty()) { throw new IOException( String.format( "Problem sending %d messages", idsNotSent.size() ) ); } } catch (AssertionError ex) { throw new IOException(ex); } }</code><technical_language>body builder? composite names rarely, required remove ambiguity</technical_language>

Target:
private void send(final Iterable<String> xemblies) throws IOException { final StringBuilder builder = new StringBuilder("Action=SendMessageBatch&Version=2011-10-01&"); final List<String> postMessages = new ArrayList<String>(); final List<String> messages = this.jsons(xemblies); for (int identifier = 0; identifier < messages.size(); ++identifier) { postMessages.add( String.format( "SendMessageBatchRequestEntry.%d.Id=%<d&SendMessageBatchRequestEntry.%<d.MessageBody=%s", identifier + 1, URLEncoder.encode( messages.get(identifier), CharEncoding.UTF_8 ) ) ); } builder.append(StringUtils.join(postMessages, '&')); final String body = builder.toString(); try { final List<String> missed = this.entry.get() .header(HttpHeaders.CONTENT_ENCODING, CharEncoding.UTF_8) .header( HttpHeaders.CONTENT_LENGTH, body.getBytes(CharEncoding.UTF_8).length ) .header( HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_FORM_URLENCODED ) .post( String.format( "sending %d lines to stand SQS queue", messages.size() ), body ) .assertStatus(HttpURLConnection.HTTP_OK) .xpath("/SendMessageBatchResponse/BatchResultError/BatchResultErrorEntry/Id/text()"); if (!missed.isEmpty()) { throw new IOException( String.format( "Problem sending %d messages", missed.size() ) ); } } catch (AssertionError ex) { throw new IOException(ex); } }
Source:
<code>public final void setConf(final Configuration conf) { checkNotNull(conf); if (!init) { try { this.conf = conf; <START> useOptimal = ConfigUtils.getUseOptimalPCJ(conf); <END> if(conf instanceof MongoDBRdfConfiguration) { final MongoDBRdfConfiguration mongoConf = new MongoDBRdfConfiguration(conf); final MongoClient client; if(mongoConf.getMongoClient() == null) { client = MongoConnectorFactory.getMongoClient(mongoConf); mongoConf.setMongoClient(client); } provider = new MongoPcjIndexSetProvider(mongoConf, mongoConf.getMongoClient()); } else { provider = new AccumuloIndexSetProvider(conf); } } catch (final Exception e) { throw new Error(e); } init = true; } }</code><technical_language>Ugh, I hate do this Interface. Stupid setConf() init</technical_language>

Target:
public final void setConf(final Configuration conf) { checkNotNull(conf); if (!init) { try { this.conf = conf; useOptimal = ConfigUtils.getUseOptimalPCJ(conf); if (conf instanceof StatefulMongoDBRdfConfiguration) { final StatefulMongoDBRdfConfiguration mongoConf = (StatefulMongoDBRdfConfiguration) conf; provider = new MongoPcjIndexSetProvider(mongoConf); } else { provider = new AccumuloIndexSetProvider(conf); } } catch (final Exception e) { throw new Error(e); } init = true; } }
Source:
<code>private String decrypt(String value) { try { return sHelper.decrypt(value); } catch (Exception e) { Logger.e(TAG, "Decryption failure", "", ADALError.ENCRYPTION_FAILED, e); Logger.v(TAG, String.format("Decryption error for key: '%s'. Item will be removed", value)); <START> removeItem(value); <END> Logger.v(TAG, String.format("Item removed for key: '%s'", value)); } return null; }</code><technical_language>removeItem handle null? E.g. want throw another exception exception handler</technical_language>

Target:
private String decrypt(String value) { try { return sHelper.decrypt(value); } catch (Exception e) { Logger.e(TAG, "Decryption failure", "", ADALError.ENCRYPTION_FAILED, e); if (!StringExtensions.IsNullOrBlank(value)) { Logger.v(TAG, String.format("Decryption error for key: '%s'. Item will be removed", value)); removeItem(value); Logger.v(TAG, String.format("Item removed for key: '%s'", value)); } } return null; }
Source:
<code>protected void failAttempt(RaftMemberContext member, RaftRequest request, Throwable error) { super.failAttempt(member, request, error); <START> if (member.getFailureCount() >= 3 && System.currentTimeMillis() - Math.max(getHeartbeatTime(), leaderTime) > raft.getElectionTimeout().toMillis() * 2) { <END> log.warn("Suspected network partition. Stepping down"); raft.setLeader(null); raft.transition(RaftServer.Role.FOLLOWER); } }</code><technical_language>move this magic number a constant</technical_language>

Target:
protected void failAttempt(RaftMemberContext member, RaftRequest request, Throwable error) { super.failAttempt(member, request, error); failHeartbeat(); if (member.getFailureCount() >= MIN_STEP_DOWN_FAILURE_COUNT && System.currentTimeMillis() - Math.max(computeHeartbeatTime(), leaderTime) > electionTimeout * 2) { log.warn("Suspected network partition. Stepping down"); raft.setLeader(null); raft.transition(RaftServer.Role.FOLLOWER); } }
Source:
<code>public void handleMessage(SoapMessage msg) throws Fault { BundleContext context = getContext(); PhaseInterceptor anonIntercep = null; <START> ServiceReference anonIntercepRef = context.getServiceReference(PhaseInterceptor.class.getName()); <END> if (anonIntercepRef != null) { anonIntercep = (PhaseInterceptor) context.getService(anonIntercepRef); } if (anonIntercep != null) { anonIntercep.handleMessage(msg); } else { LOGGER.debug("Anonymous Interceptor is not installed, ignoring"); } }</code><technical_language>want highest ranked PhaseInterceptor? add some filter AnonymousInterceptor</technical_language>

Target:
public void handleMessage(SoapMessage msg) throws Fault { BundleContext context = getContext(); PhaseInterceptor anonIntercep = null; Collection<ServiceReference<PhaseInterceptor>> anonIntercepRefs = null; if (context != null) { try { anonIntercepRefs = context.getServiceReferences(PhaseInterceptor.class, "(interceptor=anonymous)"); } catch (InvalidSyntaxException e) { } if (anonIntercepRefs != null && anonIntercepRefs.size() > 0) { Iterator<ServiceReference<PhaseInterceptor>> iterator = anonIntercepRefs.iterator(); anonIntercep = context.getService(iterator.next()); } if (anonIntercep != null) { anonIntercep.handleMessage(msg); } else { LOGGER.debug("Anonymous Interceptor is not installed, ignoring"); } } else { LOGGER.debug("Unable to acquire bundle context for anonymous interceptor"); } }
Source:
<code>public static void tearDownClass() throws Exception { <START> InstrumentationRegistry.getInstrumentation().getUiAutomation() .executeShellCommand("svc wifi enable"); <END> }</code><technical_language>For consistency this need run conditionally FEATURE_TELEPHONY is declared not. in case run "svc wifi disable"</technical_language>

Target:
public static void tearDownClass() throws Exception { if (!isSupported()) return; InstrumentationRegistry.getInstrumentation().getUiAutomation() .executeShellCommand("svc wifi enable"); }
Source:
<code>public InvokableBuilder<ResultValue> inline(Boolean value) { <START> inline = true; <END> return this; }</code><technical_language>Typo</technical_language>

Target:
public InvokableBuilder<ResultValue> inline(Boolean value) { inline = value; return this; }
Source:
<code>private void logSuccessResponseObject(Object object, String url, long callDelay) { LogLevel logLevel = restAdapter.logLevel; RestAdapter.Log log = restAdapter.log; Converter converter = restAdapter.converter; if (logLevel.log()) { log.log(String.format("<--- MOCK 200 %s (%sms)", url, callDelay)); if (logLevel.ordinal() >= LogLevel.FULL.ordinal()) { <START> if (object == null) { <END> log.log("null"); } else if (converter instanceof LoggingConverter) { LoggingConverter loggingConverter = (LoggingConverter) converter; if (mockRxSupport != null) { object = mockRxSupport.maybeUnwrap(object); } log.log(loggingConverter.bodyToString(object)); } else { log.log("(converter unable to log)"); } log.log("<--- END MOCK"); } } }</code><technical_language>want special case empty, if possible</technical_language>

Target:
private void logSuccessResponseObject(Object object, String url, long callDelay) { LogLevel logLevel = restAdapter.logLevel; RestAdapter.Log log = restAdapter.log; Converter converter = restAdapter.converter; if (logLevel.log()) { log.log(String.format("<--- MOCK 200 %s (%sms)", url, callDelay)); if (logLevel.ordinal() >= LogLevel.FULL.ordinal()) { if (object == null) { log.log("null"); } else if (converter instanceof LoggingConverter) { LoggingConverter loggingConverter = (LoggingConverter) converter; if (mockRxSupport != null) { object = mockRxSupport.maybeUnwrap(object); } log.log(loggingConverter.bodyToLogString(object)); } else { log.log("(converter unable to log)"); } log.log("<--- END MOCK"); } } }
Source:
<code>public Startpoint fromBytes(byte[] bytes) { try { LinkedHashMap<String, String> deserialized = mapper.readValue(bytes, LinkedHashMap.class); <START> return mapper.readValue(deserialized.get(STARTPOINT_OBJ), registry.get(deserialized.get(STARTPOINT_CLASS))); <END> } catch (Exception e) { throw new SamzaException(String.format("Exception in de-serializing startpoint bytes: %s", Arrays.toString(bytes)), e); } }</code><technical_language>Class.forName avoid needing a "registry". disadvantage of Class.forName is handle unexpected (or malicious, if possible) class names in store. you</technical_language>

Target:
public Startpoint fromBytes(byte[] bytes) { try { LinkedHashMap<String, String> deserialized = mapper.readValue(bytes, LinkedHashMap.class); Class<? extends Startpoint> startpointClass = (Class<? extends Startpoint>) Class.forName(deserialized.get(STARTPOINT_CLASS)); return mapper.readValue(deserialized.get(STARTPOINT_OBJ), startpointClass); } catch (Exception e) { throw new SamzaException(String.format("Exception in de-serializing startpoint bytes: %s", Arrays.toString(bytes)), e); } }
Source:
<code>public void testNonGetterValidationDoesNotOccur() throws Exception { try { assertNull( repeater.repeat( null ) ); } catch ( ConstraintViolationException e ) { <START> fail( "CDI method interceptor should not thrown an exception" ); <END> } }</code><technical_language>"thrown"="throw"</technical_language>

Target:
public void testNonGetterValidationDoesNotOccur() throws Exception { try { assertNull( repeater.repeat( null ) ); } catch ( ConstraintViolationException e ) { fail( "CDI method interceptor should not throw an exception" ); } }
Source:
<code>public void traceClosed(@Nullable TmfTraceClosedSignal signal) { cancelUpdate(); super.traceClosed(signal); setDataProvider(null); if (signal != null) { <START> fXYPresentationProvider.remove(signal.getTrace().getUUID()); <END> } }</code><technical_language>If trace is experiment, disposed UUID changed (experiment longer children, UUID computed empty string)</technical_language>

Target:
public void traceClosed(@Nullable TmfTraceClosedSignal signal) { cancelUpdate(); super.traceClosed(signal); setDataProvider(null); if (signal != null) { fXYPresentationProvider.remove(signal.getTrace()); } }
Source:
<code>public ByteBuffer compress(IteratorSetting[] iterators) { UnsynchronizedBuffer.Writer out = new UnsynchronizedBuffer.Writer(iterators.length * 8); out.writeVInt(iterators.length); for (IteratorSetting is : iterators) { out.writeVInt(getSymbolID(is.getName())); out.writeVInt(getSymbolID(is.getIteratorClass())); out.writeVInt(is.getPriority()); Map<String,String> opts = is.getOptions(); out.writeVInt(opts.size()); <START> if (!opts.isEmpty()) { <END> opts.forEach((k, v) -> { out.writeVInt(getSymbolID(k)); out.writeVInt(getSymbolID(v)); }); } } return out.toByteBuffer(); }</code><technical_language>isEmpty check necessary</technical_language>

Target:
public ByteBuffer compress(IteratorSetting[] iterators) { UnsynchronizedBuffer.Writer out = new UnsynchronizedBuffer.Writer(iterators.length * 8); out.writeVInt(iterators.length); for (IteratorSetting is : iterators) { out.writeVInt(getSymbolID(is.getName())); out.writeVInt(getSymbolID(is.getIteratorClass())); out.writeVInt(is.getPriority()); Map<String,String> opts = is.getOptions(); out.writeVInt(opts.size()); opts.forEach((key, value) -> { out.writeVInt(getSymbolID(key)); out.writeVInt(getSymbolID(value)); }); } return out.toByteBuffer(); }
Source:
<code>private void writeSubscribeCommands( String repoName, List<SubscribeCommand> commands) throws IOException { write("repository " + repoName); for (SubscribeCommand cmd : commands) { switch (cmd.getCommand()) { case SUBSCRIBE: write("want " + cmd.getSpec()); break; case UNSUBSCRIBE: write("stop " + cmd.getSpec()); break; default: <START> throw new IllegalArgumentException(); <END> } } }</code><technical_language>include cmd message</technical_language>

Target:
private void writeSubscribeCommands( String repoName, List<SubscribeCommand> commands) throws IOException { write("repository " + repoName); for (SubscribeCommand cmd : commands) { switch (cmd.getCommand()) { case SUBSCRIBE: write("want " + cmd.getSpec()); break; case UNSUBSCRIBE: write("stop " + cmd.getSpec()); break; default: throw new IllegalArgumentException(cmd.toString()); } } }
Source:
<code><START> public Optional<Control> getControlForAction(String actionId) { <END> return actionBar.getControlById(actionId); }</code><technical_language>protected enough I</technical_language>

Target:
public Optional<Control> getControlForAction(String actionId) { if (tableViewerComposite.getActionBar().isPresent()) { return tableViewerComposite.getActionBar().get().getControlById(actionId); } return Optional.empty(); }
Source:
<code>public void save(PageRequestContext requestContext) throws SetupWizardException { StudyProgrammeDAO studyProgrammeDAO = DAOFactory.getInstance().getStudyProgrammeDAO(); StudyProgrammeCategoryDAO studyProgrammeCategoryDAO = DAOFactory.getInstance().getStudyProgrammeCategoryDAO(); <START> OrganizationDAO organizationDAO = DAOFactory.getInstance().getOrganizationDAO(); <END> int rowCount = NumberUtils.createInteger(requestContext.getRequest().getParameter("studyProgrammesTable.rowCount")).intValue(); for (int i = 0; i < rowCount; i++) { String colPrefix = "studyProgrammesTable." + i; Long studyProgrammeId = requestContext.getLong(colPrefix + ".studyProgrammeId"); String name = requestContext.getString(colPrefix + ".name"); String code = requestContext.getString(colPrefix + ".code"); Long categoryId = requestContext.getLong(colPrefix + ".category"); Long organizationId = requestContext.getLong(colPrefix + ".organization"); StudyProgrammeCategory category = null; Organization organization = null; if (categoryId != null) { category = studyProgrammeCategoryDAO.findById(categoryId); } if (organizationId != null) { organization = organizationDAO.findById(organizationId); } if (studyProgrammeId == -1) { studyProgrammeDAO.create(organization, name, category, code); } } }</code><technical_language>I setup wizard ui updated include organization in this view. this defaults too</technical_language>

Target:
public void save(PageRequestContext requestContext) throws SetupWizardException { StudyProgrammeDAO studyProgrammeDAO = DAOFactory.getInstance().getStudyProgrammeDAO(); StudyProgrammeCategoryDAO studyProgrammeCategoryDAO = DAOFactory.getInstance().getStudyProgrammeCategoryDAO(); DefaultsDAO defaultsDAO = DAOFactory.getInstance().getDefaultsDAO(); Defaults defaults = defaultsDAO.getDefaults(); int rowCount = NumberUtils.createInteger(requestContext.getRequest().getParameter("studyProgrammesTable.rowCount")).intValue(); for (int i = 0; i < rowCount; i++) { String colPrefix = "studyProgrammesTable." + i; Long studyProgrammeId = requestContext.getLong(colPrefix + ".studyProgrammeId"); String name = requestContext.getString(colPrefix + ".name"); String code = requestContext.getString(colPrefix + ".code"); Long categoryId = requestContext.getLong(colPrefix + ".category"); StudyProgrammeCategory category = null; if (categoryId != null) { category = studyProgrammeCategoryDAO.findById(categoryId); } if (studyProgrammeId == -1) { studyProgrammeDAO.create(defaults.getOrganization(), name, category, code); } } }
Source:
<code>public static SchemaPlus from(Database db) { final SchemaPlus schema = CalciteSchema.createRootSchema( false , false , VoltFrameworkConfig.DEFAULT_SCHEMA_NAME).plus(); db.getTables().forEach(table -> { schema.add(table.getTypeName(), new VoltTable(table)); }); <START> for (Map.Entry<String, Triple<Class, Boolean, Class[]>> function : <END> VoltSqlFunctions.VOLT_SQL_FUNCTIONS.entries()) { schema.add(function.getKey().toUpperCase(), ScalarFunctionImpl.create(function.getValue().getLeft(), function.getKey(), function.getValue().getMiddle(), function.getValue().getRight())); } return schema; }</code><technical_language>I prefer POD Triple, is more explicit clear in</technical_language>

Target:
public static SchemaPlus from(Database db) { final SchemaPlus schema = CalciteSchema.createRootSchema( false , false , VoltFrameworkConfig.DEFAULT_SCHEMA_NAME).plus(); db.getTables().forEach(table -> { schema.add(table.getTypeName(), new VoltTable(table)); }); for (Map.Entry<Class, VoltSqlFunctions.FunctionDescriptor> function : VoltSqlFunctions.VOLT_SQL_FUNCTIONS.entries()) { switch(function.getValue().getType()){ case SCALAR: ScalarFunctionDescriptor scalarFunction = (ScalarFunctionDescriptor) function.getValue(); schema.add(scalarFunction.getFunctionName().toUpperCase(), ScalarFunctionImpl.create( function.getKey(), scalarFunction.getFunctionName(), scalarFunction.isExactArgumentTypes(), scalarFunction.getFunctionId(), scalarFunction.getArgumentTypes())); break; case AGGREGATE: AggregateFunctionDescriptor aggregateFunction = (AggregateFunctionDescriptor) function.getValue(); schema.add(aggregateFunction.getFunctionName().toUpperCase(), AggregateFunctionImpl.create( function.getKey(), aggregateFunction.getFunctionName(), aggregateFunction.isExactArgumentTypes(), aggregateFunction.getAggType(), aggregateFunction.getArgumentTypes())); break; default: break; } } return schema; }
Source:
<code>public byte[] getSignature() { <START> try (final DefaultAgentProxy agentProxy = new DefaultAgentProxy()) { <END> final byte[] bytes = stream.toByteArray(); stream.reset(); return agentProxy.sign(identity, bytes); } catch (IOException e) { throw Throwables.propagate(e); } }</code><technical_language>I changed this in 0.1.2 final AgentProxy agentProxy = AgentProxies.newInstance(), I hid impl class in a static factory</technical_language>

Target:
public byte[] getSignature() { try { return agentProxy.sign(identity, stream.toByteArray()); } catch (IOException e) { throw Throwables.propagate(e); } }
Source:
<code>boolean isAssignmentValid(AssignableNode node, AssignableReplica replica, ClusterContext clusterContext) { <START> return node.getCurrentAssignmentCount() < node.getMaxPartition() <END> && node.getCurrentAssignmentsByResource(replica.getResourceName()).size() < replica .getResourceMaxPartitionsPerInstance(); }</code><technical_language>"<="</technical_language>

Target:
boolean isAssignmentValid(AssignableNode node, AssignableReplica replica, ClusterContext clusterContext) { return node.getAssignedReplicaCount() < node.getMaxPartition() && node.getAssignedPartitionsByResource(replica.getResourceName()).size() < replica .getResourceMaxPartitionsPerInstance(); }
Source:
<code>public void globalVerify() throws Exception { if (isMemberNode(targetInstance)) { MapConfig mapConfig = targetInstance.getConfig().getMapConfig(basename); MapStoreConfig mapStoreConfig = mapConfig.getMapStoreConfig(); final MapStoreWithCounterPerKey mapStore = (MapStoreWithCounterPerKey) mapStoreConfig.getImplementation(); <START> final IMap map = targetInstance.getMap(basename); <END> assertTrueEventually(new AssertTask() { @Override public void run() throws Exception { assertEquals("The number of items in the store is incorrect. ", keyCounter.intValue(), mapStore.storeCount.size()); } },300); log.info(basename + ": Checking if some keys where stored more than once"); for (Object k : mapStore.storeCount.keySet()) { assertEquals("There were multiple calls to MapStore.store", 1, mapStore.storeCount.get(k).intValue()); } } }</code><technical_language>This variable unused</technical_language>

Target:
public void globalVerify() throws Exception { if (isMemberNode(targetInstance)) { MapConfig mapConfig = targetInstance.getConfig().getMapConfig(basename); MapStoreConfig mapStoreConfig = mapConfig.getMapStoreConfig(); Map<Object, AtomicInteger> mapStore = ((MapStoreWithCounterPerKey)mapStoreConfig.getImplementation()).storeCount; log.info(basename + ": Checking if some keys where stored more than once"); for (Object k : mapStore.keySet()) { assertEquals("There were multiple calls to MapStore.store", 1, mapStore.get(k).intValue()); } } }
Source:
<code>public void testFirst() { for (Storage storage : TestConfig.STORAGES_TO_TEST_AGAINST) { Literal javac = storage.createLiteral("javac.exe", RDF.PLAIN_LITERAL); Node mods = storage.createNode(Mods.MODS); NodeReference kitodo = storage.createNodeReference("<LINK_0>"); Node node = storage.createNode().add(javac).add(kitodo).put(Mets.TYPE, mods); node.removeAll(RDF.toURL(Node.FIRST_INDEX)); assertThat(node.first().orElse(null), is(equalTo((long) 2))); } <START> } <END></code><technical_language>test here? a test</technical_language>

Target:
public void testFirst() { for (Storage storage : TestConfig.STORAGES_TO_TEST_AGAINST) { Literal javac = storage.createLiteral("javac.exe", RDF.PLAIN_LITERAL); Node mods = storage.createNode(MODS_MODS); NodeReference kitodo = storage.createNodeReference("<LINK_0>"); Node node = storage.createNode().add(javac).add(kitodo).put(METS_TYPE, mods); node.removeAll(RDF.toURL(Node.FIRST_INDEX)); assertThat(node.first().orElse(null), is(equalTo((long) 2))); } }
Source:
<code>private static FormatParserPlugin getFormatParserPluginInstance() { FormatParserPlugin parsie = null; String parsePlugin = sage.Sage.get("mediafile_mediaformat_parser_plugin", ""); <START> <END> try { parsie = (FormatParserPlugin) Class.forName(parsePlugin, true, sage.Sage.extClassLoader).newInstance(); } catch (Throwable e1) { if (sage.Sage.DBG) { System.out.println("Error instantiating metadata parser plugin of:" + e1); } } return parsie; }</code><technical_language>Return null if parsePlugin is empty string...otherwise print error loading class for format detection for people plugin</technical_language>

Target:
private static FormatParserPlugin getFormatParserPluginInstance() { if (formatParserPluginInstance == null) { String parsePlugin = sage.Sage.get("mediafile_mediaformat_parser_plugin", ""); if (!parsePlugin.isEmpty()) { synchronized (formatParserPluginLock) { if (formatParserPluginInstance != null) { return formatParserPluginInstance; } try { formatParserPluginInstance = (FormatParserPlugin) Class.forName(parsePlugin, true, sage.Sage.extClassLoader).newInstance(); } catch (Throwable e1) { if (sage.Sage.DBG) { System.out.println("Error instantiating metadata parser plugin of: " + e1); } } } } } return formatParserPluginInstance; }