auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected Warning createWarning(final Matcher matcher) { String fileName = matcher.group(1); int lineNumber = getLineNumber(matcher.group(2)); String message = matcher.group(5); Priority priority; StringBuilder category = new StringBuilder(); if (matcher.group(3).equalsIgnoreCase("error")) { priority = Priority.HIGH; category.append("ERROR"); } else if (matcher.group(3).equalsIgnoreCase("information")) { priority = Priority.LOW; category.append("Info"); } else { priority = Priority.NORMAL; category.append("Warning"); } Warning warning = createWarning(fileName, lineNumber, category.toString(), message, priority); return warning; }

Target:
protected Warning createWarning(final Matcher matcher) { String fileName = matcher.group(1); int lineNumber = getLineNumber(matcher.group(2)); String message = matcher.group(5); Priority priority; String category; if ("error".equalsIgnoreCase(matcher.group(3))) { priority = Priority.HIGH; category = "ERROR"; } else if ("information".equalsIgnoreCase(matcher.group(3))) { priority = Priority.LOW; category = "Info"; } else { priority = Priority.NORMAL; category = "Warning"; } return createWarning(fileName, lineNumber, category, message, priority); }
Source:
protected String inferMappedName(@SuppressWarnings("unused") Class<?> mappedClass, String propertyName, Map<Class<? extends Annotation>, Annotation> annotations) { if (annotations.containsKey(Computed.class)) { String expression = ((Computed) annotations.get(Computed.class)).value(); if (expression.isEmpty()) throw new IllegalArgumentException(String.format("Property '%s': attribute 'value' of annotation @Computed is mandatory for computed properties", propertyName)); return expression; } boolean caseSensitive = false; String mappedName = namingStrategy.toCassandraName(propertyName); if (annotations.containsKey(Column.class)) { Column column = (Column) annotations.get(Column.class); caseSensitive = column.caseSensitive(); if (!column.name().isEmpty()) mappedName = column.name(); } else if (annotations.containsKey(com.datastax.driver.mapping.annotations.Field.class)) { com.datastax.driver.mapping.annotations.Field udtmappedField = (com.datastax.driver.mapping.annotations.Field) annotations.get(com.datastax.driver.mapping.annotations.Field.class); caseSensitive = udtmappedField.caseSensitive(); if (!udtmappedField.name().isEmpty()) mappedName = udtmappedField.name(); } if (mappedName == null || mappedName.isEmpty()) throw new IllegalArgumentException(String.format("Property '%s': could not infer mapped name", propertyName)); return caseSensitive ? Metadata.quote(mappedName) : mappedName.toLowerCase(); }

Target:
protected String inferMappedName(@SuppressWarnings("unused") Class<?> mappedClass, String propertyName, Map<Class<? extends Annotation>, Annotation> annotations) { if (annotations.containsKey(Computed.class)) { String expression = ((Computed) annotations.get(Computed.class)).value(); if (expression.isEmpty()) throw new IllegalArgumentException(String.format("Property '%s': attribute 'value' of annotation @Computed is mandatory for computed properties", propertyName)); return expression; } boolean caseSensitive = false; String mappedName = null; if (annotations.containsKey(Column.class)) { Column column = (Column) annotations.get(Column.class); caseSensitive = column.caseSensitive(); if (!column.name().isEmpty()) mappedName = column.name(); } else if (annotations.containsKey(com.datastax.driver.mapping.annotations.Field.class)) { com.datastax.driver.mapping.annotations.Field udtMappedField = (com.datastax.driver.mapping.annotations.Field) annotations.get(com.datastax.driver.mapping.annotations.Field.class); caseSensitive = udtMappedField.caseSensitive(); if (!udtMappedField.name().isEmpty()) mappedName = udtMappedField.name(); } if (mappedName != null) { return caseSensitive ? Metadata.quote(mappedName) : mappedName.toLowerCase(); } mappedName = namingStrategy.toCassandraName(propertyName); if (mappedName == null || mappedName.isEmpty()) throw new IllegalArgumentException(String.format("Property '%s': could not infer mapped name", propertyName)); return Metadata.quoteIfNecessary(mappedName); }
Source:
public Response getCertPw(@QueryParam("keyStore") String keyStore, @QueryParam("projectUser") String projectUser, @Context SecurityContext sc, @Context HttpServletRequest req) { try { CertPwDTO respDTO; Users user; if (projectGenericPattern.matcher(projectUser).matches()) { user = projectFacade.findByName(projectUser).getOwner(); respDTO = projectController.getProjectWideCertPw(user, projectUser, keyStore); } else { String username = hdfsUserBean.getUserName(projectUser); String projectName = hdfsUserBean.getProjectName(projectUser); user = userFacade.findByUsername(username); respDTO = projectController.getProjectSpecificCertPw(user, projectName, keyStore); } return noCacheResponse.getNoCacheResponseBuilder(Response.Status.OK).entity(respDTO).build(); } catch (Exception ex) { LOGGER.log(Level.SEVERE, "Could not retrieve certificate passwords for " + "user:" + projectUser, ex); return noCacheResponse.getNoCacheResponseBuilder(Response.Status.EXPECTATION_FAILED).build(); } }

Target:
public Response getCertPw(@QueryParam("keyStore") String keyStore, @QueryParam("projectUser") String projectUser, @Context SecurityContext sc, @Context HttpServletRequest req) { try { CertPwDTO respDTO = null; Users user; if (projectGenericPattern.matcher(projectUser).matches()) { String[] splits = projectUser.split(HdfsUsersController.USER_NAME_DELIMITER,2); user = projectFacade.findByName(splits[0]).getOwner(); respDTO = projectController.getProjectWideCertPw(user, projectUser, keyStore); } else if (projectSpecificPattern.matcher(projectUser).matches()){ String username = hdfsUserBean.getUserName(projectUser); String projectName = hdfsUserBean.getProjectName(projectUser); user = userFacade.findByUsername(username); respDTO = projectController.getProjectSpecificCertPw(user, projectName, keyStore); } else { throw new Exception("Unrecognized format for project user"); } return noCacheResponse.getNoCacheResponseBuilder(Response.Status.OK).entity(respDTO).build(); } catch (Exception ex) { LOGGER.log(Level.SEVERE, "Could not retrieve certificate passwords for " + "user:" + projectUser, ex); return noCacheResponse.getNoCacheResponseBuilder(Response.Status.EXPECTATION_FAILED).build(); } }
Source:
protected ConnectionFactory createRabbitConnectionFactory() { RabbitConnectionFactoryBean factoryBean = new RabbitConnectionFactoryBean(); configureRabbitConnectionFactory(factoryBean); try { factoryBean.afterPropertiesSet(); return factoryBean.getObject(); } catch (Exception e) { LogFactory.getLog("log4j2AppenderErrors").error("Failed to create customized Rabbit ConnectionFactory.", e); return null; } }

Target:
protected ConnectionFactory createRabbitConnectionFactory() { RabbitConnectionFactoryBean factoryBean = new RabbitConnectionFactoryBean(); configureRabbitConnectionFactory(factoryBean); try { factoryBean.afterPropertiesSet(); return factoryBean.getObject(); } catch (Exception e) { LOGGER.error("Failed to create customized Rabbit ConnectionFactory.", e); return null; } }
Source:
private static FairyModule getFairyModuleForLocale(DataMaster dataMaster, Locale locale, RandomGenerator randomGenerator) { LanguageCode code; try { code = LanguageCode.valueOf(locale.getLanguage().toUpperCase()); } catch (IllegalArgumentException e) { LOG.warn("Uknown locale " + locale); code = LanguageCode.EN; } switch (code) { case PL: return new PlFairyModule(dataMaster, randomGenerator); case EN: return new EnFairyModule(dataMaster, randomGenerator); case ES: return new EsFairyModule(dataMaster, randomGenerator); case FR: return new EsFairyModule(dataMaster, randomGenerator); case SV: return new SvFairyModule(dataMaster, randomGenerator); case ZH: return new ZhFairyModule(dataMaster, randomGenerator); case DE: return new DeFairyModule(dataMaster, randomGenerator); case KA: return new GeFairyModule(dataMaster, randomGenerator); default: LOG.info("No data for your language - using EN"); return new EnFairyModule(dataMaster, randomGenerator); } }

Target:
private static FairyModule getFairyModuleForLocale(DataMaster dataMaster, Locale locale, RandomGenerator randomGenerator) { LanguageCode code; try { code = LanguageCode.valueOf(locale.getLanguage().toUpperCase()); } catch (IllegalArgumentException e) { LOG.warn("Uknown locale " + locale); code = LanguageCode.EN; } switch (code) { case PL: return new PlFairyModule(dataMaster, randomGenerator); case EN: return new EnFairyModule(dataMaster, randomGenerator); case ES: return new EsFairyModule(dataMaster, randomGenerator); case FR: return new EsFairyModule(dataMaster, randomGenerator); case SV: return new SvFairyModule(dataMaster, randomGenerator); case ZH: return new ZhFairyModule(dataMaster, randomGenerator); case DE: return new DeFairyModule(dataMaster, randomGenerator); case KA: return new KaFairyModule(dataMaster, randomGenerator); default: LOG.info("No data for your language - using EN"); return new EnFairyModule(dataMaster, randomGenerator); } }
Source:
public Credential getCredentialsFromSAParameters( String privateKeyId, String privateKeyPem, String clientEmail, List<String> scopes, HttpTransport transport) throws IOException { logger.atFine().log("getServiceAccountCredentialFromHadoopConfiguration({})", clientEmail); if (clientEmail == null || privateKeyPem == null || privateKeyId == null) { throw new IOException("Error reading service account credential from stream, " + "expecting, 'client_email', 'private_key' and 'private_key_id'."); } PrivateKey privateKey = privateKeyFromPkcs8(privateKeyPem); GoogleCredential.Builder builder = new GoogleCredential.Builder() .setTransport(transport) .setJsonFactory(JSON_FACTORY) .setServiceAccountId(clientEmail) .setServiceAccountScopes(scopes) .setServiceAccountPrivateKey(privateKey) .setServiceAccountPrivateKeyId(privateKeyId); return new GoogleCredentialWithRetry(builder); }

Target:
public Credential getCredentialsFromSAParameters( String privateKeyId, String privateKeyPem, String clientEmail, List<String> scopes, HttpTransport transport) throws IOException { logger.atFine().log("getServiceAccountCredentialFromHadoopConfiguration(%s)", clientEmail); if (clientEmail == null || privateKeyPem == null || privateKeyId == null) { throw new IOException( "Error reading service account credential from stream, " + "expecting, 'client_email', 'private_key' and 'private_key_id'."); } PrivateKey privateKey = privateKeyFromPkcs8(privateKeyPem); GoogleCredential.Builder builder = new GoogleCredential.Builder() .setTransport(transport) .setJsonFactory(JSON_FACTORY) .setServiceAccountId(clientEmail) .setServiceAccountScopes(scopes) .setServiceAccountPrivateKey(privateKey) .setServiceAccountPrivateKeyId(privateKeyId); return new GoogleCredentialWithRetry(builder); }
Source:
public <T extends ArtifactId> ArtifactToken getArtifactOrSentinel(T artifact) { if (artifact == null) { return ArtifactToken.getSentinal(); } ArtifactToken result = ArtifactToken.getSentinal(); if (artifact instanceof Artifact) { result = AtsClientService.get().getQueryServiceClient().getArtifact(artifact); } else if (artifact instanceof IAtsObject) { IAtsObject atsObject = (IAtsObject) artifact; if (atsObject.getStoreObject() instanceof Artifact) { result = AtsClientService.get().getQueryServiceClient().getArtifact(atsObject); } else { result = getArtifact(atsObject.getId()); } } else { result = getArtifactOrSentinel(artifact.getId()); } return result; }

Target:
public <T extends ArtifactId> ArtifactToken getArtifactOrSentinel(T artifact) { if (artifact == null) { return ArtifactToken.getSentinal(); } ArtifactToken result = ArtifactToken.getSentinal(); if (artifact instanceof Artifact) { result = AtsClientService.get().getQueryServiceClient().getArtifact(artifact); } else if (artifact instanceof IAtsObject) { IAtsObject atsObject = (IAtsObject) artifact; if (atsObject.getStoreObject() instanceof Artifact) { result = AtsClientService.get().getQueryServiceClient().getArtifact(atsObject); } else { result = getArtifactOrSentinel(atsObject.getId()); } } else { result = getArtifactOrSentinel(artifact.getId()); } return result; }
Source:
public int compare(InboxMessage m1, InboxMessage m2) { int timeComparison = Timestamps.compare(m1.getWhenReceived(), m2.getWhenReceived()); if (timeComparison != 0) { return timeComparison; } int versionComparison = Integer.compare(m1.getVersion(), m2.getVersion()); if(versionComparison != 0) { return versionComparison; } return m1.getId().getUuid().compareTo(m2.getId().getUuid()); }

Target:
public int compare(InboxMessage m1, InboxMessage m2) { int result = Comparator .comparing(InboxMessage::getWhenReceived, Timestamps.comparator()) .thenComparing(InboxMessage::getVersion) .thenComparing((m) -> m.getId() .getUuid()) .compare(m1, m2); return result; }
Source:
public boolean status() { return status != null && status.equals("Enabled"); }

Target:
public boolean status() { return ("Enabled").equals(status); }
Source:
public TableDescriptor get(TableName tableName) throws IOException { invocations++; if (usecache) { TableDescriptor cachedtdm = this.cache.get(tableName); if (cachedtdm != null) { cachehits++; return cachedtdm; } if (fsvisited) { return null; } } TableDescriptor tdmt = null; try { tdmt = getTableDescriptorFromFs(fs, rootdir, tableName); } catch (NullPointerException e) { LOG.debug("Exception during readTableDecriptor. Current table name = " + tableName, e); } catch (TableInfoMissingException e) { } catch (IOException ioe) { LOG.debug("Exception during readTableDecriptor. Current table name = " + tableName, ioe); } if (usecache && tdmt != null) { this.cache.put(tableName, tdmt); } return tdmt; }

Target:
public TableDescriptor get(TableName tableName) { invocations++; if (usecache) { TableDescriptor cachedtdm = this.cache.get(tableName); if (cachedtdm != null) { cachehits++; return cachedtdm; } if (fsvisited) { return null; } } TableDescriptor tdmt = null; try { tdmt = getTableDescriptorFromFs(fs, rootdir, tableName); } catch (TableInfoMissingException e) { } catch (NullPointerException | IOException ioe) { LOG.debug("Exception during readTableDecriptor. Current table name = " + tableName, ioe); } if (usecache && tdmt != null) { this.cache.put(tableName, tdmt); } return tdmt; }
Source:
public void sendDirectMessage(Message message, User toUser) { MessageDestination destinationEntity = toUser.getNamedMessageDestination(); destinationEntity.send(message); if (!toUser.isCreatedOnBuddyRequest()) { smsService.send(toUser.getMobileNumber(), SmsTemplate.DIRECT_MESSAGE_NOTIFICATION, new HashMap<>()); } }

Target:
public void sendDirectMessage(Message message, User toUser) { MessageDestination destinationEntity = toUser.getNamedMessageDestination(); destinationEntity.send(message); if (!toUser.isCreatedOnBuddyRequest()) { smsService.send(toUser.getMobileNumber(), SmsTemplate.DIRECT_MESSAGE_NOTIFICATION, Collections.emptyMap()); } }
Source:
public Map<ColumnName, @Nullable Object> valuesIn(E entity) { checkNotNull(entity); Map<ColumnName, @Nullable Object> result = new HashMap<>(); systemColumns.forEach( column -> result.put(column.name(), column.valueIn(entity)) ); simpleColumns.forEach( column -> result.put(column.name(), column.valueIn(entity.state())) ); return result; }

Target:
public Map<ColumnName, @Nullable Object> valuesIn(E entity) { checkNotNull(entity); Map<ColumnName, @Nullable Object> result = new HashMap<>(); systemColumns.forEach( column -> result.put(column.name(), column.valueIn(entity)) ); stateColumns.forEach( column -> result.put(column.name(), column.valueIn(entity.state())) ); return unmodifiableMap(result); }
Source:
private void checkTernary( ExecutableSequence s, ObjectContract c, Set<Integer> values, ErrorRevealingChecks checks) { for (Integer i : values) { for (Integer j : values) { for (Integer k : values) { ExecutionOutcome result1 = s.getResult(i); ExecutionOutcome result2 = s.getResult(j); ExecutionOutcome result3 = s.getResult(k); if (Log.isLoggingOn()) { Log.logLine("Checking contract " + c.getClass() + " on " + i + ", " + j + ", " + k); } ExecutionOutcome exprOutcome = ObjectContractUtils.execute( c, ((NormalExecution) result1).getRuntimeValue(), ((NormalExecution) result2).getRuntimeValue(), ((NormalExecution) result3).getRuntimeValue()); if (exprOutcome instanceof NormalExecution) { NormalExecution e = (NormalExecution) exprOutcome; if (e.getRuntimeValue().equals(true)) { if (Log.isLoggingOn()) Log.logLine("Contract returned true."); } else { if (Log.isLoggingOn()) Log.logLine("Contract returned false. Will add ExpressionEqFalse check"); checks.add(new ObjectCheck(c, i, s.sequence.getVariable(i), s.sequence.getVariable(j), s.sequence.getVariable(k))); } } else if (exprOutcome instanceof ExceptionalExecution) { Throwable e = ((ExceptionalExecution) exprOutcome).getException(); if (Log.isLoggingOn()) Log.logLine("Contract threw exception: " + e.getMessage()); if (e instanceof BugInRandoopException) { throw new BugInRandoopException(e); } } else { throw new Error("Contract failed to execute during evaluation"); } } } } }

Target:
private void checkTernary( ExecutableSequence s, ObjectContract c, Set<Integer> values, ErrorRevealingChecks checks) { for (Integer i : values) { ExecutionOutcome result1 = s.getResult(i); for (Integer j : values) { ExecutionOutcome result2 = s.getResult(j); for (Integer k : values) { ExecutionOutcome result3 = s.getResult(k); if (Log.isLoggingOn()) { Log.logLine("Checking contract " + c.getClass() + " on indices " + i + ", " + j + ", " + k); } ExecutionOutcome exprOutcome = ObjectContractUtils.execute( c, ((NormalExecution) result1).getRuntimeValue(), ((NormalExecution) result2).getRuntimeValue(), ((NormalExecution) result3).getRuntimeValue()); if (exprOutcome instanceof NormalExecution) { NormalExecution e = (NormalExecution) exprOutcome; if (e.getRuntimeValue().equals(true)) { if (Log.isLoggingOn()) Log.logLine("Contract returned true."); } else { if (Log.isLoggingOn()) Log.logLine("Contract returned false. Will add ExpressionEqFalse check"); checks.add(new ObjectCheck(c, i, s.sequence.getVariable(i), s.sequence.getVariable(j), s.sequence.getVariable(k))); } } else if (exprOutcome instanceof ExceptionalExecution) { Throwable e = ((ExceptionalExecution) exprOutcome).getException(); if (Log.isLoggingOn()) Log.logLine("Contract threw exception: " + e.getMessage()); if (e instanceof BugInRandoopException) { throw (BugInRandoopException) e; } } else { throw new Error("Contract failed to execute during evaluation"); } } } } }
Source:
public static Integer convertToInteger(String value) { Integer result = null; if (value != null && !value.isEmpty() && !value.equalsIgnoreCase("N/A") && !value.equalsIgnoreCase("NA") && !value.equals("-") && !value.equals("--")) { try { result = Integer.valueOf(value); } catch (NumberFormatException e) { logger.debug("Cannot convert to Integer", value); result = null; } } return result; }

Target:
public static Integer convertToInteger(String value) { Integer result = null; if (isValid(value)) { try { result = Integer.valueOf(value.trim()); } catch (NumberFormatException e) { LoggerFactory.getLogger(WeatherUndergroundJsonUtils.class).debug("Cannot convert to Integer", value); result = null; } } return result; }
Source:
public static String readFileAsString(MultipartFile file) throws ValidationException { StringBuffer data = new StringBuffer(); try { try (BufferedReader reader = new BufferedReader(new InputStreamReader(file.getInputStream()))) { String line = null; while ((line = reader.readLine()) != null) { if (data.length() > 0) { data.append(System.getProperty("line.separator")); } data.append(line); } } } catch (final IOException ex) { String msg = "Could not read file: " + ex.getMessage(); LOGGER.error(msg); throw new ValidationException(msg); } return data.toString(); }

Target:
public static String readFileAsString(MultipartFile file) throws ValidationException { StringBuffer data = new StringBuffer(); try (BufferedReader reader = new BufferedReader(new InputStreamReader(file.getInputStream()))) { String line = null; while ((line = reader.readLine()) != null) { if (data.length() > 0) { data.append(System.getProperty("line.separator")); } data.append(line); } } catch (final IOException ex) { String msg = "Could not read file: " + ex.getMessage(); LOGGER.error(msg); throw new ValidationException(msg); } return data.toString(); }
Source:
public BOAndDPCompileHook() { System.out.println("Loaded BO and DP compile hook"); }

Target:
public BOAndDPCompileHook() { System.out.println("Loaded Blue Ocean and Declarative Pipeline compile hook"); }
Source:
public Mono<ConfigurationSetting> addSetting(ConfigurationSetting setting) { try { return withContext(context -> addSetting(setting, context)) .flatMap(response -> Mono.justOrEmpty(response.getValue())); } catch (RuntimeException ex) { return Mono.error(logger.logExceptionAsError(Exceptions.propagate(ex))); } }

Target:
public Mono<ConfigurationSetting> addSetting(ConfigurationSetting setting) { try { return withContext(context -> addSetting(setting, context)) .flatMap(response -> Mono.justOrEmpty(response.getValue())); } catch (RuntimeException ex) { return monoError(logger, ex); } }
Source:
private Constraint fairAssignmentCountPerTeam(ConstraintFactory constraintFactory) { return constraintFactory.from(TeamAssignment.class) .filter(teamAssignment -> teamAssignment.getTeam() != null) .groupBy(TeamAssignment::getTeam, loadBalanceByCount()) .penalize("fairAssignmentCountPerTeam", HardMediumSoftScore.ONE_MEDIUM, (team, result) -> (int) (Math.sqrt(((Long[])result)[1]) * 1000.0)); }

Target:
private Constraint fairAssignmentCountPerTeam(ConstraintFactory constraintFactory) { return constraintFactory.from(TeamAssignment.class) .groupBy(TeamAssignment::getTeam, loadBalanceByCount()) .penalize("fairAssignmentCountPerTeam", HardMediumSoftScore.ONE_MEDIUM, (team, result) -> (int) (Math.sqrt(((long[])result)[1]) * 1000.0)); }
Source:
private CompletableFuture<Boolean> connectAsync() { final CompletableFuture<Boolean> completableFuture = new CompletableFuture<>(); Executors.newSingleThreadExecutor() .submit( () -> { boolean connected; try { connected = client.connectBlocking(DEFAULT_CONNECT_TIMEOUT_MILLIS, TimeUnit.MILLISECONDS); } catch (final InterruptedException ignored) { connected = false; } return completableFuture.complete(connected); }); return completableFuture; }

Target:
private CompletableFuture<Boolean> connectAsync() { final CompletableFuture<Boolean> completableFuture = new CompletableFuture<>(); new Thread( () -> { boolean connected; try { connected = client.connectBlocking(DEFAULT_CONNECT_TIMEOUT_MILLIS, TimeUnit.MILLISECONDS); } catch (final InterruptedException ignored) { connected = false; } completableFuture.complete(connected); }) .start(); return completableFuture; }
Source:
public MatchResult detailMatches(PlanNode node, PlanNodeCost cost, Session session, Metadata metadata, SymbolAliases symbolAliases) { checkState(shapeMatches(node), "Plan testing framework error: shapeMatches returned false in detailMatches in %s", this.getClass().getName()); IndexSourceNode indexSourceNode = (IndexSourceNode) node; TableMetadata tableMetadata = metadata.getTableMetadata(session, indexSourceNode.getTableHandle()); String actualTableName = tableMetadata.getTable().getTableName(); return new MatchResult( expectedTableName.equalsIgnoreCase(actualTableName) && ((!expectedConstraint.isPresent()) || domainsMatch(expectedConstraint, indexSourceNode.getEffectiveTupleDomain(), indexSourceNode.getTableHandle(), session, metadata))); }

Target:
public MatchResult detailMatches(PlanNode node, PlanNodeCost cost, Session session, Metadata metadata, SymbolAliases symbolAliases) { checkState(shapeMatches(node), "Plan testing framework error: shapeMatches returned false in detailMatches in %s", this.getClass().getName()); IndexSourceNode indexSourceNode = (IndexSourceNode) node; TableMetadata tableMetadata = metadata.getTableMetadata(session, indexSourceNode.getTableHandle()); String actualTableName = tableMetadata.getTable().getTableName(); if (!expectedTableName.equalsIgnoreCase(actualTableName)) { return NO_MATCH; } if (expectedConstraint.isPresent() && !domainsMatch( expectedConstraint, indexSourceNode.getEffectiveTupleDomain(), indexSourceNode.getTableHandle(), session, metadata)) { return NO_MATCH; } return match(); }
Source:
public static MapfishMapContext createMapContext(final MapAttributeValues mapValues) { final Dimension mapSize = mapValues.getMapSize(); Rectangle paintArea = new Rectangle(mapSize); final double dpi = mapValues.getDpi(); MapBounds bounds = mapValues.getMapBounds(); bounds = adjustBoundsToScaleAndMapSize(mapValues, paintArea, bounds, dpi); final double dpiRatio = dpi / PDF_DPI; paintArea.setBounds(0, 0, (int) (mapSize.getWidth() * dpiRatio), (int) (mapSize.getHeight() * dpiRatio)); return new MapfishMapContext(bounds, paintArea.getSize(), mapValues.getRotation(), dpi, mapValues.longitudeFirst, mapValues.isDpiSensitiveStyle()); }

Target:
public static MapfishMapContext createMapContext(final MapAttributeValues mapValues) { final Dimension mapSize = mapValues.getMapSize(); Rectangle paintArea = new Rectangle(mapSize); final double dpi = mapValues.getDpi(); MapBounds bounds = mapValues.getMapBounds(); bounds = adjustBoundsToScaleAndMapSize(mapValues, paintArea, bounds, dpi); final double dpiRatio = dpi / PDF_DPI; paintArea.setBounds(0, 0, (int) Math.ceil(mapSize.getWidth() * dpiRatio), (int) Math.ceil(mapSize.getHeight() * dpiRatio)); return new MapfishMapContext(bounds, paintArea.getSize(), mapValues.getRotation(), dpi, mapValues.longitudeFirst, mapValues.isDpiSensitiveStyle()); }
Source:
public void closeAsync() throws IOException { if (anyAreSet(state, FLAG_CLOSED) || servletRequestContext.getOriginalResponse().isTreatAsCommitted()) { return; } if (!servletRequestContext.getExchange().isInIoThread()) { servletRequestContext.getExchange().getIoThread().execute(new Runnable() { @Override public void run() { try { closeAsync(); } catch (IOException e) { throw new RuntimeException(e); } } }); return; } try { state |= FLAG_CLOSED; state &= ~FLAG_READY; if (allAreClear(state, FLAG_WRITE_STARTED) && channel == null) { if (servletRequestContext.getOriginalResponse().getHeader(Headers.TRANSFER_ENCODING_STRING) == null) { if (buffer == null) { servletRequestContext.getOriginalResponse().setHeader(Headers.CONTENT_LENGTH, "0"); } else { servletRequestContext.getOriginalResponse().setHeader(Headers.CONTENT_LENGTH, Integer.toString(buffer.position())); } } } createChannel(); if (buffer != null) { if (!flushBufferAsync(true)) { return; } if (pooledBuffer != null) { pooledBuffer.close(); buffer = null; } else { buffer = null; } } channel.shutdownWrites(); state |= FLAG_DELEGATE_SHUTDOWN; if (!channel.flush()) { channel.resumeWrites(); } } catch (IOException e) { if (pooledBuffer != null) { pooledBuffer.close(); pooledBuffer = null; buffer = null; } throw e; } }

Target:
public void closeAsync() throws IOException { if (anyAreSet(state, FLAG_CLOSED) || servletRequestContext.getOriginalResponse().isTreatAsCommitted()) { return; } if (!servletRequestContext.getExchange().isInIoThread()) { servletRequestContext.getExchange().getIoThread().execute(new Runnable() { @Override public void run() { try { closeAsync(); } catch (IOException e) { UndertowLogger.REQUEST_IO_LOGGER.closeAsyncFailed(e); } } }); return; } try { state |= FLAG_CLOSED; state &= ~FLAG_READY; if (allAreClear(state, FLAG_WRITE_STARTED) && channel == null) { if (servletRequestContext.getOriginalResponse().getHeader(Headers.TRANSFER_ENCODING_STRING) == null) { if (buffer == null) { servletRequestContext.getOriginalResponse().setHeader(Headers.CONTENT_LENGTH, "0"); } else { servletRequestContext.getOriginalResponse().setHeader(Headers.CONTENT_LENGTH, Integer.toString(buffer.position())); } } } createChannel(); if (buffer != null) { if (!flushBufferAsync(true)) { return; } if (pooledBuffer != null) { pooledBuffer.close(); buffer = null; } else { buffer = null; } } channel.shutdownWrites(); state |= FLAG_DELEGATE_SHUTDOWN; if (!channel.flush()) { channel.resumeWrites(); } } catch (IOException e) { if (pooledBuffer != null) { pooledBuffer.close(); pooledBuffer = null; buffer = null; } throw e; } }
Source:
public void shouldCommunicateWithHermesUsingHttp2() { SSLContextSupplier sslSupplier = getSslContextSupplier(); HermesClient client = hermesClient(new OkHttpSender(sslSupplier.get())).withURI(topicURI_SSL).build(); HermesResponse response = client.publish(topic.qualifiedName(), message.body()).join(); assertThat(response.getHeader("OkHttp-Selected-Protocol")).isEqualTo("h2"); }

Target:
public void shouldCommunicateWithHermesUsingHttp2() { HermesClient client = hermesClient(new OkHttpHermesSender(getOkHttpClientWithSslContextConfigured())).withURI(sslTopicUri).build(); HermesResponse response = client.publish(topic.qualifiedName(), message.body()).join(); assertThat(response.getHeader("OkHttp-Selected-Protocol")).isEqualTo("h2"); }
Source:
public Bundle getBundle(String symbolicName) { State systemState = getPlatformAdmin().getState(false); BundleDescription bundleDescriptor = systemState.getBundle(symbolicName, null); if (bundleDescriptor != null) { Bundle bundle = bundleDescriptor.getBundle(); if ((bundle.getState() & (Bundle.INSTALLED | Bundle.UNINSTALLED)) == 0) { return bundle; } } return null; }

Target:
public Bundle getBundle(String symbolicName) { Bundle[] bundles = getBundles(symbolicName, null); return bundles != null && bundles.length > 0 ? bundles[0] : null; }
Source:
public DeterministicKeyChain(DeterministicKey watchingKey, long creationTimeSeconds) { checkArgument(!watchingKey.hasPrivKey(), "Private subtrees not currently supported"); checkArgument(watchingKey.getPath().size() == 1, "You can only watch an account key currently"); basicKeyChain = new BasicKeyChain(); this.creationTimeSeconds = creationTimeSeconds; this.seed = null; initializeHierarchyUnencrypted(watchingKey); }

Target:
public DeterministicKeyChain(DeterministicKey watchingKey, long creationTimeSeconds) { checkArgument(watchingKey.isPubKeyOnly(), "Private subtrees not currently supported"); checkArgument(watchingKey.getPath().size() == 1, "You can only watch an account key currently"); basicKeyChain = new BasicKeyChain(); this.creationTimeSeconds = creationTimeSeconds; this.seed = null; initializeHierarchyUnencrypted(watchingKey); }
Source:
private HttpMethod runMethod(HttpMessage msg, boolean isFollowRedirect, HttpMethodParams params) throws IOException { HttpMethod method = null; modifyUserAgent(msg); method = helper.createRequestMethod(msg.getRequestHeader(), msg.getRequestBody(), params); if (!(method instanceof EntityEnclosingMethod) || method instanceof ZapGetMethod) { method.setFollowRedirects(isFollowRedirect); } updateCookieState(); User forceUser = this.getUser(msg); if (forceUser != null) { this.executeMethod(method, forceUser.getCorrespondingHttpState()); } else { this.executeMethod(method, client.getState()); } HttpMethodHelper.updateHttpRequestHeaderSent(msg.getRequestHeader(), method); return method; }

Target:
private HttpMethod runMethod(HttpMessage msg, boolean isFollowRedirect, HttpMethodParams params) throws IOException { HttpMethod method = null; modifyUserAgent(msg); method = helper.createRequestMethod(msg.getRequestHeader(), msg.getRequestBody(), params); if (!(method instanceof EntityEnclosingMethod) || method instanceof ZapGetMethod) { method.setFollowRedirects(isFollowRedirect); } User forceUser = this.getUser(msg); if (forceUser != null) { this.executeMethod(method, forceUser.getCorrespondingHttpState()); } else { this.executeMethod(method, null); } HttpMethodHelper.updateHttpRequestHeaderSent(msg.getRequestHeader(), method); return method; }
Source:
public void aggregate(final ByteBuffer buf, final int position) { final ArrayOfDoublesSketch update = selector.getObject(); if (update == null) { return; } final WritableMemory mem = WritableMemory.wrap(buf); final WritableMemory region = mem.writableRegion(position, maxIntermediateSize); final ArrayOfDoublesUnion union = ArrayOfDoublesSketches.wrapUnion(region); union.update(update); }

Target:
public void aggregate(final ByteBuffer buf, final int position) { final ArrayOfDoublesSketch update = selector.getObject(); if (update == null) { return; } final WritableMemory mem = WritableMemory.wrap(buf); final WritableMemory region = mem.writableRegion(position, maxIntermediateSize); final Lock lock = stripedLock.getAt(ArrayOfDoublesSketchBuildBufferAggregator.lockIndex(position)).writeLock(); lock.lock(); try { final ArrayOfDoublesUnion union = ArrayOfDoublesSketches.wrapUnion(region); union.update(update); } finally { lock.unlock(); } }
Source:
private Portal getPortalData(String name, LocationWrapper first, LocationWrapper second) { try (Connection connection = db.getConnection(); PreparedStatement getPortalData = connection.prepareStatement(DatabaseManager.getPortalData);) { getPortalData.setString(1, name); ResultSet set = getPortalData.executeQuery(); if (!set.next()) return null; int specialId = set.getInt("portal_type"); String serverName = set.getString("server_name"); String partner = set.getString("partner_id"); PortalLoadEvent event = new PortalLoadEvent(name, specialId, serverName, partner, first, second); Bukkit.getPluginManager().callEvent(event); if (event.getPortal() == null) return null; return event.getPortal(); } catch (SQLException e) { logger.log(Level.SEVERE, "Failed to getPortalData for {0}", name); logger.log(Level.SEVERE, "Failed to getPortalData, exception:", e); } return null; }

Target:
private Portal getPortalData(String name, LocationWrapper first, LocationWrapper second) { try (Connection connection = db.getConnection(); PreparedStatement getPortalData = connection.prepareStatement(DatabaseManager.getPortalData);) { getPortalData.setString(1, name); ResultSet set = getPortalData.executeQuery(); if (!set.next()) return null; int specialId = set.getInt("portal_type"); String serverName = set.getString("server_name"); String partner = set.getString("partner_id"); boolean currentServer = serverName.equals(MercuryAPI.serverName()); PortalFactory factory = BetterShardsPlugin.getPortalManager().getPortalFactory(); Class<? extends Portal> clazz = factory.getPortal(specialId); Portal p = factory.buildPortal(clazz); p.setName(name); p.setIsOnCurrentServer(true); p.setServerName(MercuryAPI.serverName()); p.setFirstLocation(first); p.setSecondLocation(second); p.setPartnerPortal(partner); p.valuesPopulated(); return p; } catch (SQLException e) { logger.log(Level.SEVERE, "Failed to getPortalData for {0}", name); logger.log(Level.SEVERE, "Failed to getPortalData, exception:", e); } return null; }
Source:
private void assertLatestScheduledVerticesAreEqualTo(final List<TestingSchedulingExecutionVertex> expected) { final List<List<ExecutionVertexDeploymentOption>> deploymentOptions = testingSchedulerOperation.getScheduledVertices(); assertThat(expected.size(), Matchers.lessThanOrEqualTo(deploymentOptions.size())); for (int i = 0; i < expected.size(); i++) { assertEquals( idsFromVertices(Collections.singletonList(expected.get(expected.size() - i - 1))), idsFromDeploymentOptions(deploymentOptions.get(deploymentOptions.size() - i - 1))); } }

Target:
private void assertLatestScheduledVerticesAreEqualTo(final List<TestingSchedulingExecutionVertex> expected) { final List<List<ExecutionVertexDeploymentOption>> deploymentOptions = testingSchedulerOperation.getScheduledVertices(); assertThat(expected.size(), lessThanOrEqualTo(deploymentOptions.size())); for (int i = 0; i < expected.size(); i++) { assertEquals( idsFromVertices(Collections.singletonList(expected.get(expected.size() - i - 1))), idsFromDeploymentOptions(deploymentOptions.get(deploymentOptions.size() - i - 1))); } }
Source:
public Response createFromYaml(String data) throws ServerException, ConflictException, NotFoundException, ValidationException, BadRequestException { throw new BadRequestException( "This is an outdated method please use /api/workspace/devfile to create a new workspace"); }

Target:
public Response createFromYaml(String data) throws ServerException, ConflictException, NotFoundException, ValidationException, BadRequestException { throw new BadRequestException( "This method is deprecated and may be removed at any time. Please use /api/workspace/devfile to create a new workspace"); }
Source:
private int outputTest(StringBuilder buffer, TestResult failedTest, boolean showStack, boolean showMessage, int lengthLeft) { StringBuilder local = new StringBuilder(); local.append(failedTest.isPassed() ? "PASSED" : "FAILED").append(": "); if(failedTest instanceof CaseResult) { local.append(((CaseResult)failedTest).getClassName()); } else { local.append(failedTest.getFullName()); } local.append('.').append(failedTest.getDisplayName()).append('\n'); if (showMessage) { String errorDetails = escapeHtml ? escapeHtml(failedTest.getErrorDetails()) : failedTest.getErrorDetails(); local.append("\nError Message:\n").append(errorDetails).append('\n'); } if (showStack) { String stackTrace = escapeHtml ? escapeHtml(failedTest.getErrorStackTrace()) : failedTest.getErrorStackTrace(); local.append("\nStack Trace:\n").append(stackTrace).append('\n'); } if (showMessage || showStack) { local.append('\n'); } if(local.length() > lengthLeft) { local.setLength(lengthLeft); } buffer.append(local.toString()); return local.length(); }

Target:
private int outputTest(StringBuilder buffer, TestResult failedTest, boolean showStack, boolean showMessage, int lengthLeft) { StringBuilder local = new StringBuilder(); String lineBreak = getLineBreak(); local.append(failedTest.isPassed() ? "PASSED" : "FAILED").append(": "); if(failedTest instanceof CaseResult) { local.append(((CaseResult)failedTest).getClassName()); } else { local.append(failedTest.getFullName()); } local.append('.').append(failedTest.getDisplayName()).append(lineBreak); if (showMessage) { String errorDetails = escapeHtml ? escapeHtml(failedTest.getErrorDetails()) : failedTest.getErrorDetails(); local.append(lineBreak).append("Error Message:").append(lineBreak).append(errorDetails).append(lineBreak); } if (showStack) { String stackTrace = escapeHtml ? escapeHtml(failedTest.getErrorStackTrace()) : failedTest.getErrorStackTrace(); local.append(lineBreak).append("Stack Trace:").append(lineBreak).append(stackTrace).append(lineBreak); } if (showMessage || showStack) { local.append(lineBreak); } if(local.length() > lengthLeft) { local.setLength(lengthLeft); } buffer.append(local.toString()); return local.length(); }
Source:
public ApiAuthenticationResult authenticate(HttpRequest httpRequest) { Assert.notNull(httpRequest, "httpRequest argument cannot be null."); if (ServletHttpRequest.class.isAssignableFrom(httpRequest.getClass())){ this.httpRequest = (ServletHttpRequest) httpRequest; } else { Assert.isInstanceOf(HttpRequest.class, httpRequest, "The specified httpRequest argument must be an instance of " + HttpRequest.class.getName() + " or " + ServletHttpRequest.class.getName()); this.httpRequest = httpRequest; } return this.execute(); }

Target:
public ApiAuthenticationResult authenticate(HttpRequest httpRequest) { Assert.notNull(httpRequest, "httpRequest argument cannot be null."); if (ServletHttpRequest.class.isAssignableFrom(httpRequest.getClass())){ this.httpRequest = httpRequest; } else { Assert.isInstanceOf(HttpRequest.class, httpRequest, "The specified httpRequest argument must be an instance of " + HttpRequest.class.getName() + " or " + ServletHttpRequest.class.getName()); this.httpRequest = httpRequest; } return this.execute(); }
Source:
public CapabilityCollection(AccessSection section) { if (section == null) { section = new AccessSection(AccessSection.GLOBAL_CAPABILITIES); } Map<String, List<PermissionRule>> tmp = new HashMap<>(); for (Permission permission : section.getPermissions()) { for (PermissionRule rule : permission.getRules()) { if (!permission.getName().equals(GlobalCapability.EMAIL_REVIEWERS) && rule.getAction() == PermissionRule.Action.DENY) { continue; } List<PermissionRule> r = tmp.get(permission.getName()); if (r == null) { r = new ArrayList<>(2); tmp.put(permission.getName(), r); } r.add(rule); } } configureDefaults(tmp, section); Map<String, List<PermissionRule>> res = new HashMap<>(); for (Map.Entry<String, List<PermissionRule>> e : tmp.entrySet()) { List<PermissionRule> rules = e.getValue(); if (rules.size() == 1) { res.put(e.getKey(), Collections.singletonList(rules.get(0))); } else { res.put(e.getKey(), Collections.unmodifiableList( Arrays.asList(rules.toArray(new PermissionRule[rules.size()])))); } } permissions = Collections.unmodifiableMap(res); administrateServer = getPermission(GlobalCapability.ADMINISTRATE_SERVER); emailReviewers = getPermission(GlobalCapability.EMAIL_REVIEWERS); priority = getPermission(GlobalCapability.PRIORITY); queryLimit = getPermission(GlobalCapability.QUERY_LIMIT); batchChangesLimit = getPermission(GlobalCapability.BATCH_CHANGES_LIMIT); }

Target:
public CapabilityCollection(AccessSection section) { if (section == null) { section = new AccessSection(AccessSection.GLOBAL_CAPABILITIES); } Map<String, List<PermissionRule>> tmp = new HashMap<>(); for (Permission permission : section.getPermissions()) { for (PermissionRule rule : permission.getRules()) { if (!permission.getName().equals(GlobalCapability.EMAIL_REVIEWERS) && rule.getAction() == PermissionRule.Action.DENY) { continue; } List<PermissionRule> r = tmp.get(permission.getName()); if (r == null) { r = new ArrayList<>(2); tmp.put(permission.getName(), r); } r.add(rule); } } configureDefaults(tmp, section); Map<String, List<PermissionRule>> res = new HashMap<>(); for (Map.Entry<String, List<PermissionRule>> e : tmp.entrySet()) { List<PermissionRule> rules = e.getValue(); if (rules.size() == 1) { res.put(e.getKey(), Collections.singletonList(rules.get(0))); } else { res.put(e.getKey(), Collections.unmodifiableList( Arrays.asList(rules.toArray(new PermissionRule[rules.size()])))); } } permissions = Collections.unmodifiableMap(res); administrateServer = getPermission(GlobalCapability.ADMINISTRATE_SERVER); batchChangesLimit = getPermission(GlobalCapability.BATCH_CHANGES_LIMIT); emailReviewers = getPermission(GlobalCapability.EMAIL_REVIEWERS); priority = getPermission(GlobalCapability.PRIORITY); queryLimit = getPermission(GlobalCapability.QUERY_LIMIT); }
Source:
public SizeCommand(Cache<Object, ?> cache, long flags) { setFlagsBitSet(flags); AdvancedCache<Object, ?> advancedCache = cache.getAdvancedCache(); if (flags != EnumUtil.EMPTY_BIT_SET) { advancedCache = advancedCache.withFlags(EnumUtil.enumArrayOf(flags, Flag.class)); } this.cache = advancedCache.getCacheConfiguration().memory().storageType() == StorageType.OBJECT ? advancedCache : advancedCache.withEncoding(IdentityEncoder.class); }

Target:
public SizeCommand(Cache<Object, ?> cache, long flags) { setFlagsBitSet(flags); AdvancedCache<Object, ?> advancedCache = cache.getAdvancedCache(); if (flags != EnumUtil.EMPTY_BIT_SET) { advancedCache = advancedCache.withFlags(EnumUtil.enumArrayOf(flags, Flag.class)); } this.cache = advancedCache.withEncoding(IdentityEncoder.class); }
Source:
public TextBoxLabel() { super(new EmptyValueRenderer<String>() { @Override public String render(String value) { String renderedText = super.render(value); return renderedText; } }); }

Target:
public TextBoxLabel() { super(new EmptyValueRenderer<String>()); }
Source:
private void updateStoragePoolFormatType() { final storage_pool storagePool = getStoragePool(); final Guid spId = storagePool.getId(); final VDSBrokerFrontend resourceManager = Backend.getInstance().getResourceManager(); final Version spVersion = storagePool.getcompatibility_version(); final Version oldSpVersion = _oldStoragePool.getcompatibility_version(); if (Version.OpEquality(spVersion, oldSpVersion)) { return; } StorageFormatType targetFormat = StorageFormatType.V1; if (spVersion.compareTo(Version.v3_0) == 0) { targetFormat = StorageFormatType.V2; } else if (spVersion.compareTo(Version.v3_1) == 0) { targetFormat = StorageFormatType.V3; } StorageType spType = storagePool.getstorage_pool_type(); if (targetFormat == StorageFormatType.V2 && spType != StorageType.ISCSI && spType != StorageType.FCP) { return; } storagePool.setStoragePoolFormatType(targetFormat); getStoragePoolDAO().update(storagePool); updateMemberDomainsFormat(targetFormat); if (storagePool.getstatus() != StoragePoolStatus.Up) { return; } UpgradeStoragePoolVDSCommandParameters parameters = new UpgradeStoragePoolVDSCommandParameters(spId, targetFormat); resourceManager.RunVdsCommand( VDSCommandType.UpgradeStoragePool, parameters); }

Target:
private void updateStoragePoolFormatType() { final storage_pool storagePool = getStoragePool(); final Guid spId = storagePool.getId(); final Version spVersion = storagePool.getcompatibility_version(); final Version oldSpVersion = _oldStoragePool.getcompatibility_version(); if (Version.OpEquality(spVersion, oldSpVersion)) { return; } StorageFormatType targetFormat = StorageFormatType.V1; if (spVersion.compareTo(Version.v3_0) == 0) { targetFormat = StorageFormatType.V2; } else if (spVersion.compareTo(Version.v3_1) == 0) { targetFormat = StorageFormatType.V3; } StorageType spType = storagePool.getstorage_pool_type(); if (targetFormat == StorageFormatType.V2 && spType != StorageType.ISCSI && spType != StorageType.FCP) { return; } storagePool.setStoragePoolFormatType(targetFormat); getStoragePoolDAO().update(storagePool); updateMemberDomainsFormat(targetFormat); if (storagePool.getstatus() != StoragePoolStatus.Up) { return; } UpgradeStoragePoolVDSCommandParameters parameters = new UpgradeStoragePoolVDSCommandParameters(spId, targetFormat); if (getStoragePool().getstatus() == StoragePoolStatus.Up) { runVdsCommand(VDSCommandType.UpgradeStoragePool, parameters); } }
Source:
public Collection<Unit> getTargetUnits() { return Collections.unmodifiableCollection(targetUnits); }

Target:
public Collection<Unit> getTargetUnits() { return targetUnits; }
Source:
public void registerIn(final ActionRegistry registry) { registry.register(ChangeAttributeMetadataCommand.class, new CommandHandler<ChangeAttributeMetadataCommand>() { @Override public void handleCommand(final ChangeAttributeMetadataCommand command, final List response) { final Attribute attribute = getServerModelStore().findAttributeById(command.getAttributeId()); if (attribute == null) { LOG.debug("Cannot find attribute with id '{}'. Metadata remains unchanged.", command.getAttributeId()); return; } ((ServerAttribute) attribute).silently(new Runnable() { @Override public void run() { if(command.getMetadataName().equals(Attribute.VALUE_NAME)) { attribute.setValue(command.getValue()); } else if(command.getMetadataName().equals(Attribute.QUALIFIER_NAME)) { if(command.getValue() == null) { ((ServerAttribute) attribute).setQualifier(null); } else { ((ServerAttribute) attribute).setQualifier(command.getValue().toString()); } } else { throw new RuntimeException("Metadata type wrong!"); } } }); } }); }

Target:
public void registerIn(final ActionRegistry registry) { registry.register(ChangeAttributeMetadataCommand.class, new CommandHandler<ChangeAttributeMetadataCommand>() { @Override public void handleCommand(final ChangeAttributeMetadataCommand command, final List response) { final Attribute attribute = getServerModelStore().findAttributeById(command.getAttributeId()); if (attribute == null) { LOG.warn("Cannot find attribute with id '{}'. Metadata remains unchanged.", command.getAttributeId()); return; } ((ServerAttribute) attribute).silently(new Runnable() { @Override public void run() { if(command.getMetadataName().equals(Attribute.VALUE_NAME)) { attribute.setValue(command.getValue()); } else if(command.getMetadataName().equals(Attribute.QUALIFIER_NAME)) { if(command.getValue() == null) { ((ServerAttribute) attribute).setQualifier(null); } else { ((ServerAttribute) attribute).setQualifier(command.getValue().toString()); } } else { throw new RuntimeException("Metadata type wrong!"); } } }); } }); }