auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void resetAndSync(NomadChangeInfo[] nomadChanges) { DynamicConfigNomadSynchronizer nomadSynchronizer = new DynamicConfigNomadSynchronizer( nomadServerManager.getConfiguration().orElse(null), nomadServerManager.getNomadServer()); try { nomadSynchronizer.syncNomadChanges(Arrays.asList(nomadChanges)); } catch (NomadException e) { <START> throw new RuntimeException(e); <END> } }</code><technical_language>I throw instead like: throw new IllegalStateException("Unable reset sync Nomad system: " + e.getMessage(), e);. reason is exception's message is user in CLI output diagnostic client call is deserialized wrapping leak internal class name appended message, this is user freiendly</technical_language>

Target:
public void resetAndSync(NomadChangeInfo[] nomadChanges) { UpgradableNomadServer<NodeContext> nomadServer = nomadServerManager.getNomadServer(); DynamicConfigNomadSynchronizer nomadSynchronizer = new DynamicConfigNomadSynchronizer( nomadServerManager.getConfiguration().orElse(null), nomadServer); List<NomadChangeInfo> backup; try { backup = nomadServer.getAllNomadChanges(); } catch (NomadException e) { throw new IllegalStateException("Unable to reset and sync Nomad system: " + e.getMessage(), e); } try { nomadSynchronizer.syncNomadChanges(Arrays.asList(nomadChanges)); } catch (NomadException e) { try { nomadServer.reset(); nomadSynchronizer.syncNomadChanges(backup); } catch (NomadException nomadException) { e.addSuppressed(nomadException); } throw new IllegalStateException("Unable to reset and sync Nomad system: " + e.getMessage(), e); } }
Source:
<code>public static String lpad(@Nonnull String base, int len, @Nonnull String pad) { <START> if (len < 0 || pad.isEmpty()) { <END> return null; } else if (len == 0) { return ""; } char[] data = new char[len]; int pos = Math.max(len - base.length(), 0); for (int i = 0; i < pos; i += pad.length()) { for (int j = 0; j < pad.length() && j < pos - i; j++) { data[i + j] = pad.charAt(j); } } for (int i = 0; pos + i < len && i < base.length(); i++) { data[pos + i] = base.charAt(i); } return new String(data); }</code><technical_language>rpad() need a similar change</technical_language>

Target:
public static String lpad(@Nonnull String base, int len, @Nonnull String pad) { if (len <= 0) { return ""; } int pos = Math.max(len - base.length(), 0); if (pos > 0 && pad.isEmpty()) { return base; } char[] data = new char[len]; for (int i = 0; !pad.isEmpty() && i < pos; i += pad.length()) { for (int j = 0; j < pad.length() && j < pos - i; j++) { data[i + j] = pad.charAt(j); } } for (int i = 0; pos + i < len && i < base.length(); i++) { data[pos + i] = base.charAt(i); } return new String(data); }
Source:
<code>public void shouldReturnProxyHostWhenHostDoesNotMatchNonProxyHosts() { <START> assertNotNull(ProxyConfigurator.create(method, "proxy.example.org", "3128", "www.example.org")); <END> }</code><technical_language>expect assertion happen state of ProxyHost instance is returned, object exists - assertThat(proxyHost.getPort(), is(...)) assertThat(proxyHost.getHost(), is(...)) assertThat(proxyHost.getProtocol(), is(...))</technical_language>

Target:
public void shouldReturnProxyHostWhenHostDoesNotMatchNonProxyHosts() throws IOException { final Properties proxyProperties = readProxyProperties(); proxyProperties.setProperty("http.nonProxyHosts", "www.example.org"); final ProxyHost httpProxy = ProxyConfigurator.create(HTTP_METHOD, proxyProperties); assertThat(httpProxy.getHostName(), is(HTTP_PROXY_HOST)); assertThat(httpProxy.getPort(), is(Integer.valueOf(HTTP_PROXY_PORT))); }
Source:
<code>public boolean connect(Node ... nodeList) { boolean returnValue = true; <START> Preconditions.checkArgument(nodeList.length > 1, "Expected at least 2 nodes as arguments to connect()"); <END> Node fromNode = null; for (Node toNode : nodeList) { Preconditions.checkNotNull(toNode, "toNode cannot be null!"); if (fromNode != null) { boolean success = graph.putEdge(fromNode, toNode); if (!success) { logger.warn("Trying to connect two already connected nodes, " + fromNode.getUri() + " and " + toNode.getUri()); } returnValue = returnValue && success; } fromNode = toNode; } return returnValue; }</code><technical_language>Preconditions.checkArgument(nodeList.length > 1, "Expected 2 nodes arguments connect() - "+nodeList.length);</technical_language>

Target:
public void connect(Node ... nodeList) { Preconditions.checkArgument(nodeList.length > 1, "Expected at least 2 nodes as arguments to connect() - found " + nodeList.length); Node fromNode = null; for (Node toNode : nodeList) { Preconditions.checkNotNull(toNode, "toNode cannot be null!"); if (fromNode != null) { if (!graph.hasEdgeConnecting(fromNode, toNode)) { graph.putEdge(fromNode, toNode); } else { logger.warn("Trying to connect two already connected nodes, " + fromNode.getUri() + " and " + toNode.getUri()); } } fromNode = toNode; } }
Source:
<code>protected Class<?>[] getAnnotatedClasses() { <START> return new Class<?>[]{Parent.class, Child.class}; <END> }</code><technical_language>Add SubChild well, SubChild is persisted a Child currently.</technical_language>

Target:
protected Class<?>[] getAnnotatedClasses() { return new Class<?>[]{Parent.class, Child.class, SubChild.class}; }
Source:
<code>protected void populateMatchNode(MatchNode matchNode) { Match match = matchNode.getMatch(); <START> if (isMatchWithOnlyResourceAttachmentChanges(match)) { <END> return; } Multimap<Match, Diff> diffsBySubMatch = LinkedHashMultimap.create(); for (Diff diff : filter(match.getDifferences(), filter)) { if (mustDisplayAsDirectChildOfMatch(diff)) { Match targetMatch = getTargetMatch(diff); if (match == targetMatch) { addDiffNode(matchNode, diff); } else if (match.getSubmatches().contains(targetMatch)) { diffsBySubMatch.put(targetMatch, diff); } else if (targetMatch != null) { MatchNode targetMatchNode = createMatchNode(targetMatch); matchNode.addSubMatchNode(targetMatchNode); addDiffNode(targetMatchNode, diff); } } } for (Match subMatch : match.getSubmatches()) { MatchNode subMatchNode = createMatchNode(subMatch); for (Diff subMatchDiff : diffsBySubMatch.get(subMatch)) { addDiffNode(subMatchNode, subMatchDiff); } diffsBySubMatch.removeAll(subMatch); populateMatchNode(subMatchNode); if (!subMatchNode.getChildren().isEmpty()) { matchNode.addSubMatchNode(subMatchNode); } } }</code><technical_language>I this is efficient be. sufficient add RasourceAttachmentChange node a MatchNode (since want display ResourceMatchNodes) prevent multiple wlaks diffs of matches</technical_language>

Target:
protected void populateMatchNode(MatchNode matchNode) { Match match = matchNode.getMatch(); Multimap<Match, Diff> diffsBySubMatch = LinkedHashMultimap.create(); for (Diff diff : filter(match.getDifferences(), filter)) { if (mustDisplayAsDirectChildOfMatch(diff)) { Match targetMatch = getTargetMatch(diff); if (match == targetMatch) { addDiffNode(matchNode, diff); } else if (match.getSubmatches().contains(targetMatch)) { diffsBySubMatch.put(targetMatch, diff); } else if (targetMatch != null) { MatchNode targetMatchNode = createMatchNode(targetMatch); matchNode.addSubMatchNode(targetMatchNode); addDiffNode(targetMatchNode, diff); } } } for (Match subMatch : match.getSubmatches()) { MatchNode subMatchNode = createMatchNode(subMatch); for (Diff subMatchDiff : diffsBySubMatch.get(subMatch)) { addDiffNode(subMatchNode, subMatchDiff); } diffsBySubMatch.removeAll(subMatch); populateMatchNode(subMatchNode); if (!subMatchNode.getChildren().isEmpty()) { matchNode.addSubMatchNode(subMatchNode); } } }
Source:
<code>private String getValueForOptionalKey(JSONObject object, String key) throws JSONException { <START> return object.has(key) ? object.getJSONObject(key).getString("value") : ""; <END> }</code><technical_language>I patch set change. change in this line, object.getJSONObject(key), is good, prefer optString("value") throw Exception this alter flow. If of calls L40-41 throws, subsequent lines in parseImageLicenseMetadata() tried</technical_language>

Target:
private String getValueForOptionalKey(JSONObject object, String key) throws JSONException { return object.has(key) ? object.getJSONObject(key).optString("value") : ""; }
Source:
<code>String parse(Process process){ try { BufferedReader bufferedReader = new BufferedReader( new InputStreamReader(process.getInputStream())); StringBuilder log = new StringBuilder(); String line; while ((line = bufferedReader.readLine()) != null) { log.append(line + "\n"); } return log.toString(); } catch (IOException e) { <START> e.printStackTrace(); <END> } return context.getString(R.string.output_is_empty); }</code><technical_language>@vzool more printStackTrace</technical_language>

Target:
String parse(Process process){ try { BufferedReader bufferedReader = new BufferedReader( new InputStreamReader(process.getInputStream())); StringBuilder log = new StringBuilder(); String line; while ((line = bufferedReader.readLine()) != null) { log.append(line + "\n"); } return log.toString(); } catch (IOException e) { Log.e(TAG, "Exception(05): " + e.getMessage()); } return context.getString(R.string.output_is_empty); }
Source:
<code>public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof UserTuneElement)) { return false; } UserTuneElement userTuneElement = (UserTuneElement) obj; <START> return this.toXML().toString().contentEquals(userTuneElement.toXML().toString()); <END> }</code><technical_language>do String.contentEquals() argument's type is String? want remove toString(). better: Compare field of elements</technical_language>

Target:
public boolean equals(Object obj) { return EqualsUtil .equals(this, obj, (equalsBuilder, otherTune) -> equalsBuilder .append(artist, otherTune.artist) .append(length, otherTune.length) .append(rating, otherTune.rating) .append(source, otherTune.source) .append(title, otherTune.source) .append(title, otherTune.title) .append(track, otherTune.track) .append(uri, otherTune.uri)); }
Source:
<code>public void registerActivityQueuer(IActivityQueuer activityQueuer) { if (activityQueuer == null || !activityQueuerChangeAllowed) { return; } synchronized (this.activityQueuer) { if (activityQueuerChangeAllowed) { log.info("register a new Activity Queue Handler: " + activityQueuer); <START> this.activityQueuer = activityQueuer; <END> activityQueuerChangeAllowed = false; } } }</code><technical_language>replace activityQueuer object a lock. I understand locking, this allow another thread enter synchronized block current thread left replaced object for locking. I wrong this? If this is case, current logic lead concurrency issues replace lock-object setting if condition. This allow another thread enter synchronized block activityQueuer replaced activityQueuerChangeAllowed is set false current thread, meaning thread proceed if block replace activityQueuer object. avoid this problem (if is a problem), set activityQueuerChangeAllowed replacing object unrelated object lock</technical_language>

Target:
public boolean registerActivityQueuer(IActivityQueuer activityQueuer) { if (activityQueuer == null || !activityQueuerChangeAllowed.get()) { return false; } if (activityQueuerChangeAllowed.compareAndSet(true, false)) { log.info("register a new Activity Queue Handler: " + activityQueuer); this.activityQueuer = activityQueuer; return true; } return false; }
Source:
<code>static int[] encode(final Cigar cigar) { if (cigar.numCigarElements() == 0) { return new int[0]; } final int[] binaryCigar = new int[cigar.numCigarElements()]; int binaryCigarLength = 0; for (int i = 0; i < cigar.numCigarElements(); ++i) { final CigarElement cigarElement = cigar.getCigarElement(i); <START> final int op = cigarElement.getOperator().bamCode(); <END> binaryCigar[binaryCigarLength++] = cigarElement.getLength() << 4 | op; } return binaryCigar; }</code><technical_language>bamCode clearer getBamEncoding fromBamCode -> fromBamEncoding</technical_language>

Target:
static int[] encode(final Cigar cigar) { if (cigar.numCigarElements() == 0) { return new int[0]; } final int[] binaryCigar = new int[cigar.numCigarElements()]; int binaryCigarLength = 0; for (int i = 0; i < cigar.numCigarElements(); ++i) { final CigarElement cigarElement = cigar.getCigarElement(i); final int op = cigarElement.getOperator().getBamEncoding(); binaryCigar[binaryCigarLength++] = cigarElement.getLength() << 4 | op; } return binaryCigar; }
Source:
<code>private String formatRoute(Collection<IResourceUIModel> routes) { if(routes.size() > 0) { IRoute route = (IRoute)routes.iterator().next().getResource(); <START> return String.format("%s%s", route.getHost(), route.getPath()); <END> } return ""; }</code><technical_language>host path separated a /</technical_language>

Target:
private String formatRoute(Collection<IResourceUIModel> routes) { if(routes.size() > 0) { IRoute route = (IRoute)routes.iterator().next().getResource(); return route.getURL(); } return ""; }
Source:
<code>protected RepositoryMetadata resolveFromInterface(Class<?> repositoryInterface) { if (!Repository.class.isAssignableFrom(repositoryInterface)) { throw new RepositoryDefinitionException(repositoryInterface, "Expected interface to extend " + Repository.class); } final Class<?>[] arguments = GenericTypeResolver.resolveTypeArguments(repositoryInterface, Repository.class); final Class<?> entityType = arguments[0]; final Class<?> rawIdType = arguments[1]; <START> final Class<?> idType = rawIdType.asSubclass(Object.class); final String idProperty = resolveIdProperty(entityType, idType); return new ImmutableRepositoryMetadata(idType, entityType, repositoryInterface, idProperty); <END> }</code><technical_language>suggestion final String idProperty = resolveIdProperty(entityType, rawIdType); return new ImmutableRepositoryMetadata(rawIdType, entityType, repositoryInterface, idProperty);</technical_language>

Target:
protected RepositoryMetadata resolveFromInterface(Class<?> repositoryInterface) { if (!Repository.class.isAssignableFrom(repositoryInterface)) { throw new RepositoryDefinitionException(repositoryInterface, "Expected interface to extend " + Repository.class); } final Class<?>[] arguments = GenericTypeResolver.resolveTypeArguments(repositoryInterface, Repository.class); final Class<?> entityType = arguments[0]; final Class<?> idType = arguments[1]; final String idProperty = resolveIdProperty(entityType, idType); return new ImmutableRepositoryMetadata(idType, entityType, repositoryInterface, idProperty); }
Source:
<code>private MediaLayout createPromptMedia(DisplayUnit display) { DisplayData displayData = display.evaluate(); String promptText = Localizer.processArguments(displayData.getName(), new String[]{""}).trim(); TextView text = new TextView(getApplicationContext()); text.setText(promptText); int padding = (int)getResources().getDimension(R.dimen.help_text_padding); <START> text.setPadding(0, 0, 0, 7); <END> MediaLayout helpLayout = new MediaLayout(this); helpLayout.setAVT(text, displayData.getAudioURI(), displayData.getImageURI(), true); helpLayout.setPadding(padding, padding, padding, padding); text.setTextColor(Color.BLACK); return helpLayout; }</code><technical_language>this hardcoded</technical_language>

Target:
private MediaLayout createPromptMedia(DisplayUnit display) { DisplayData displayData = display.evaluate(); String promptText = Localizer.processArguments(displayData.getName(), new String[]{""}).trim(); TextView text = new TextView(getApplicationContext()); text.setText(promptText); text.setPadding(0, 0, 0, 7); text.setTextColor(Color.BLACK); MediaLayout helpLayout = new MediaLayout(this); helpLayout.setAVT(text, displayData.getAudioURI(), displayData.getImageURI(), true); int padding = (int)getResources().getDimension(R.dimen.help_text_padding); helpLayout.setPadding(padding, padding, padding, padding); return helpLayout; }
Source:
<code>public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { super.onCreateOptionsMenu(menu, inflater); inflater.inflate(R.menu.file_actions_menu, menu); MenuItem item = menu.findItem(R.id.action_see_details); if (item != null) { item.setVisible(false); item.setEnabled(false); } item = menu.findItem(R.id.action_send_file); boolean sendEnabled = getString(R.string.send_files_to_other_apps).equalsIgnoreCase("on"); if (item != null && sendEnabled) { item.setVisible(true); item.setEnabled(true); } else { <START> item.setVisible(false); <END> item.setEnabled(false); } }</code><technical_language>If item is null, code enter a crash. condition split in two; item != null, code is done (including if (sendEnabled) ... else ...) ; if null, do</technical_language>

Target:
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { super.onCreateOptionsMenu(menu, inflater); inflater.inflate(R.menu.file_actions_menu, menu); MenuItem item = menu.findItem(R.id.action_see_details); if (item != null) { item.setVisible(false); item.setEnabled(false); } item = menu.findItem(R.id.action_send_file); boolean sendEnabled = getString(R.string.send_files_to_other_apps).equalsIgnoreCase("on"); if (item != null) { if (sendEnabled) { item.setVisible(true); item.setEnabled(true); } else { item.setVisible(false); item.setEnabled(false); } } }
Source:
<code>protected Node getContainerNode(Node currentNode, org.jbpm.workflow.core.NodeContainer nodeContainer, long nodeId) { for (Node node : nodeContainer.getNodes()) { if (nodeId == node.getId()) { if (currentNode != null) { <START> return currentNode; <END> } } else { if (node instanceof org.jbpm.workflow.core.NodeContainer) { return getContainerNode(node, (org.jbpm.workflow.core.NodeContainer) node, nodeId); } } } return null; }</code><technical_language>I looked this time. Is this check needed? If currentNode is null, immediately return null nodeId is unique, match of conditions more once, eventually reach return null;</technical_language>

Target:
protected Node getContainerNode(Node currentNode, org.jbpm.workflow.core.NodeContainer nodeContainer, long nodeId) { for (Node node : nodeContainer.getNodes()) { if (nodeId == node.getId()) { return currentNode; } else { if (node instanceof org.jbpm.workflow.core.NodeContainer) { return getContainerNode(node, (org.jbpm.workflow.core.NodeContainer) node, nodeId); } } } return null; }
Source:
<code>private void startRealtimeUpdates(Bundle params, Itinerary itinerary) { Log.d(TAG, "Checking whether to start realtime updates."); <START> SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()); <END> if (prefs.getBoolean(OTPConstants.PREFERENCE_KEY_LIVE_UPDATES, true)) { boolean realtimeLegsOnItineraries = true; for (Leg leg : itinerary.legs) { if (leg.realTime) { realtimeLegsOnItineraries = true; } } if (realtimeLegsOnItineraries) { Log.d(TAG, "Starting realtime updates for itinerary"); getAlarmManager().setInexactRepeating(AlarmManager.RTC, new Date().getTime(), OTPConstants.DEFAULT_UPDATE_INTERVAL_TRIP_TIME, getAlarmIntent(params)); } else { Log.d(TAG, "No realtime legs on itinerary"); } } }</code><technical_language>prefer singleton method get preferences, in app: SharedPreferences prefs = Application.getPrefs();</technical_language>

Target:
private void startRealtimeUpdates(Bundle params, Itinerary itinerary) { Log.d(TAG, "Checking whether to start realtime updates."); boolean realtimeLegsOnItineraries = false; for (Leg leg : itinerary.legs) { if (leg.realTime) { realtimeLegsOnItineraries = true; } } if (realtimeLegsOnItineraries) { Log.d(TAG, "Starting realtime updates for itinerary"); getAlarmManager().setInexactRepeating(AlarmManager.RTC, new Date().getTime(), OTPConstants.DEFAULT_UPDATE_INTERVAL_TRIP_TIME, getAlarmIntent(params)); } else { Log.d(TAG, "No realtime legs on itinerary"); } }
Source:
<code>public void setBucketTags(SetBucketTagsArgs args) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, XmlParserException { if (args == null) { throw new IllegalArgumentException("null arguments"); } Map<String, String> queryParamMap = new HashMap<>(); queryParamMap.put("tagging", ""); <START> Response response = executePut(args.bucket(), null, null, queryParamMap, args.tags(), 0); response.body().close(); <END> }</code><technical_language>suggestion executePut(args.bucket(), null, null, queryParamMap, args.tags(), 0).body().close(); variable response necessary</technical_language>

Target:
public void setBucketTags(SetBucketTagsArgs args) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, XmlParserException { checkArgs(args); Map<String, String> queryParamMap = new HashMap<>(); queryParamMap.put("tagging", ""); Response response = executePut(args.bucket(), null, null, queryParamMap, args.tags(), 0); response.close(); }
Source:
<code>public Resource getResource(final String resourceName, final int resourceType, final String encoding) throws ResourceNotFoundException, ParseErrorException { <START> final HttpServletRequest request = HttpServletRequestThreadLocal.INSTANCE.getRequest(); <END> final User user = getUser(request); final String resourceKey = resourceType + resourceName + user.getUserId(); Resource resource = globalCache.get(resourceKey); if (resource != null) { try { if (resource.requiresChecking()) { resource = refreshResource(resource, encoding); } } catch (ResourceNotFoundException rnfe) { globalCache.remove(resourceKey); return getResource(resourceName, resourceType, encoding); } catch (ParseErrorException pee) { Logger.error(this,"ResourceManager.getResource() exception", pee); throw pee; } catch (RuntimeException re) { Logger.error(this,"ResourceManager.getResource() exception", re); throw re; } } else { try { resource = loadResource(resourceName, resourceType, encoding); if (DotResourceLoader.getInstance().isCachingOn()) { globalCache.put(resourceKey, resource); } } catch (ResourceNotFoundException rnfe) { Logger.error(this,"ResourceManager : unable to find resource '" + resourceName + "' in any resource loader."); throw rnfe; } catch (ParseErrorException pee) { Logger.error(this,"ResourceManager.getResource() parse exception", pee); throw pee; } catch (RuntimeException re) { Logger.error(this,"ResourceManager.getResource() load exception", re); throw re; } } return resource; }</code><technical_language>This is this works - cache a resource user</technical_language>

Target:
public Resource getResource(final String resourceName, final int resourceType, final String encoding) throws ResourceNotFoundException, ParseErrorException { final HttpServletRequest request = HttpServletRequestThreadLocal.INSTANCE.getRequest(); final String resourceKey = resourceType + resourceName; Resource resource = globalCache.get(resourceKey); if (resource != null) { try { if (resource.requiresChecking()) { resource = refreshResource(resource, encoding); } } catch (ResourceNotFoundException rnfe) { globalCache.remove(resourceKey); return getResource(resourceName, resourceType, encoding); } catch (ParseErrorException pee) { Logger.error(this,"ResourceManager.getResource() exception", pee); throw pee; } catch (RuntimeException re) { Logger.error(this,"ResourceManager.getResource() exception", re); throw re; } } else { try { resource = loadResource(resourceName, resourceType, encoding); if (DotResourceLoader.getInstance().isCachingOn()) { globalCache.put(resourceKey, resource); } } catch (ResourceNotFoundException rnfe) { Logger.error(this,"ResourceManager : unable to find resource '" + resourceName + "' in any resource loader."); throw rnfe; } catch (ParseErrorException pee) { Logger.error(this,"ResourceManager.getResource() parse exception", pee); throw pee; } catch (RuntimeException re) { Logger.error(this,"ResourceManager.getResource() load exception", re); throw re; } } return resource; }
Source:
<code>public Slf4jReporter build() { LoggerHelper loggerHelper; switch (loggingLevel) { case TRACE: loggerHelper = new TraceLoggerHelper(logger); break; case DEBUG: loggerHelper = new DebugLoggerHelper(logger); break; case INFO: loggerHelper = new InfoLoggerHelper(logger); break; case WARN: loggerHelper = new WarnLoggerHelper(logger); break; case ERROR: loggerHelper = new ErrorLoggerHelper(logger); break; } <START> loggerHelper = new DebugLoggerHelper(logger); <END> return new Slf4jReporter(registry, loggerHelper, marker, rateUnit, durationUnit, filter); }</code><technical_language>this set debug</technical_language>

Target:
public Slf4jReporter build() { LoggerHelper loggerHelper; switch (loggingLevel) { case ERROR: loggerHelper = new ErrorLoggerHelper(logger); break; case WARN: loggerHelper = new WarnLoggerHelper(logger); break; case INFO: loggerHelper = new InfoLoggerHelper(logger); break; case TRACE: loggerHelper = new TraceLoggerHelper(logger); break; default: loggerHelper = new DebugLoggerHelper(logger); break; } return new Slf4jReporter(registry, loggerHelper, marker, rateUnit, durationUnit, filter); }
Source:
<code>public void unregisterAll() { <START> metricsModes.clear(); <END> }</code><technical_language>mentioned earlier, calls need regenerate iterator. Please double-check</technical_language>

Target:
public void unregisterAll() { modes.clear(); cursor = 0; register(defaultMode); currentMode = defaultMode; }
Source:
<code>public boolean hasCompatibleAnalyzer(LuceneFieldPredicateBuilderFactory other) { if ( !( other instanceof LuceneTextFieldPredicateBuilderFactory ) ) { return false; } LuceneTextFieldPredicateBuilderFactory castedOther = (LuceneTextFieldPredicateBuilderFactory) other; return Objects.equals( analyzer, castedOther.analyzer ) <START> && Objects.equals( searchAnalyzer, castedOther.searchAnalyzer ) <END> && Objects.equals( normalizer, castedOther.normalizer ); }</code><technical_language>for Elasticsearch backend: I need a separate condition for search analyzer. override analyzerOrNormalizer searchAnalyzer, enough predicates concerned</technical_language>

Target:
public boolean hasCompatibleAnalyzer(LuceneFieldPredicateBuilderFactory other) { if ( !( other instanceof LuceneTextFieldPredicateBuilderFactory ) ) { return false; } LuceneTextFieldPredicateBuilderFactory castedOther = (LuceneTextFieldPredicateBuilderFactory) other; return Objects.equals( analyzerOrNormalizer, castedOther.analyzerOrNormalizer ); }
Source:
<code>public void validateRetentionPolicy() { String[] validSet = new String[]{"true", "keep_all", "false", "keep_none", "10 files", "10k files", "10K size", "10m txs", "10M entries", "10g hours", "10G days"}; String[] invalidSet = new String[]{"invalid", "all", "10", "10k", "10k a"}; for ( String valid : validSet ) { <START> Config.defaults( keep_logical_logs, valid ); <END> } for ( String invalid : invalidSet ) { try { Config.defaults( keep_logical_logs, invalid ); fail( "Value \"" + invalid + "\" should be considered invalid" ); } catch ( InvalidSettingException ignored ) { } } }</code><technical_language>i need add a bit more assertions</technical_language>

Target:
public void validateRetentionPolicy() { String[] validSet = new String[]{"true", "keep_all", "false", "keep_none", "10 files", "10k files", "10K size", "10m txs", "10M entries", "10g hours", "10G days"}; String[] invalidSet = new String[]{"invalid", "all", "10", "10k", "10k a"}; for ( String valid : validSet ) { assertEquals( valid, Config.defaults( keep_logical_logs, valid ).get( keep_logical_logs ) ); } for ( String invalid : invalidSet ) { try { Config.defaults( keep_logical_logs, invalid ); fail( "Value \"" + invalid + "\" should be considered invalid" ); } catch ( InvalidSettingException ignored ) { } } }
Source:
<code><START> public void testAmend() throws Exception { <END> Repository repository = lookupRepository(repositoryFile); RevCommit oldHeadCommit = TestUtil.getHeadCommit(repository); commitOneFileChange("Yet another Change"); RevCommit headCommit = TestUtil.getHeadCommit(repository); String changeId = CommitMessageUtil.extractChangeId(headCommit .getFullMessage()); configureTestCommitterAsUser(repository); setTestFileContent("Changes over changes"); CommitDialogTester commitDialogTester = CommitDialogTester .openCommitDialog(PROJ1); commitDialogTester.setAmend(true); assertTrue(commitDialogTester.getCommitMessage().indexOf("Change-Id") > 0); assertTrue(commitDialogTester.getCommitMessage().indexOf( "Signed-off-by") > 0); assertTrue(commitDialogTester.getSignedOff()); assertTrue(commitDialogTester.getInsertChangeId()); commitDialogTester.commit(); headCommit = TestUtil.getHeadCommit(repository); assertEquals(oldHeadCommit, headCommit.getParent(0)); assertTrue(headCommit.getFullMessage().indexOf(changeId) > 0); }</code><technical_language>test is failing Mac some parts \n other rely Text.DELIMITER line ending, instead in CommitMessageComponent</technical_language>

Target:
public void testAmend() throws Exception { Repository repository = lookupRepository(repositoryFile); RevCommit oldHeadCommit = TestUtil.getHeadCommit(repository); commitOneFileChange("Yet another Change"); RevCommit headCommit = TestUtil.getHeadCommit(repository); String changeId = CommitMessageUtil.extractChangeId(headCommit .getFullMessage().replaceAll("\n", Text.DELIMITER)); configureTestCommitterAsUser(repository); setTestFileContent("Changes over changes"); CommitDialogTester commitDialogTester = CommitDialogTester .openCommitDialog(PROJ1); commitDialogTester.setAmend(true); assertTrue(commitDialogTester.getCommitMessage().indexOf("Change-Id") > 0); assertTrue(commitDialogTester.getCommitMessage().indexOf( "Signed-off-by") > 0); assertTrue(commitDialogTester.getSignedOff()); assertTrue(commitDialogTester.getInsertChangeId()); commitDialogTester.commit(); headCommit = TestUtil.getHeadCommit(repository); assertEquals(oldHeadCommit, headCommit.getParent(0)); assertTrue(headCommit.getFullMessage().indexOf(changeId) > 0); }
Source:
<code>public Server getServer(ObjectNode obj, String location, ParseResult result) { if (obj == null) { return null; } Server server = new Server(); <START> String value = getString("url", obj, true, location, result); <END> server.setUrl(value); value = getString("description", obj, false, location, result); server.setDescription(value); server.setVariables(getServerVariables(obj,location,result)); server.setExtensions(new LinkedHashMap<>()); Set<String> keys = getKeys(obj); for(String key : keys) { if(key.startsWith("x-")) { server.getExtensions().put(key, Json.mapper().convertValue(obj.get(key), Object.class)); } } return server; }</code><technical_language>ParseResult location store messages user. In this case, url is a mandatory field if present, user missing</technical_language>

Target:
public Server getServer(ObjectNode obj, String location, ParseResult result) { if (obj == null) { return null; } Server server = new Server(); String value = getString("url", obj, true, location, result); if(StringUtils.isNotBlank(value)) { server.setUrl(value); } value = getString("description", obj, false, location, result); if(StringUtils.isNotBlank(value)) { server.setDescription(value); } ServerVariables serverVariables = getServerVariables(obj,location,result); if (serverVariables != null && serverVariables.size() > 0){ server.setVariables(serverVariables); } Map <String,Object> extensions = getExtensions(obj,location,result); if(extensions != null && extensions.size() > 0) { server.setExtensions(extensions); } return server; }
Source:
<code>public boolean process(Exchange exchange, AsyncCallback callback) { final Message in = exchange.getIn(); String firebaseKey = (String) in.getHeader(endpoint.getKeyName()); Object value = in.getBody(); DatabaseReference ref = FirebaseDatabase .getInstance(endpoint.getFirebaseApp()) .getReference(rootReference).child(firebaseKey); ref.setValue(value, (DatabaseError databaseError, DatabaseReference databaseReference) -> { if (databaseError != null) { exchange.setException(new DatabaseErrorException(databaseError)); <START> exchange.getOut().setFault(true); <END> } else { exchange.getOut().setBody(databaseReference); } callback.done(endpoint.isAsync()); }); return endpoint.isAsync(); }</code><technical_language>Dont fault is some legacy stuff for JBI/WS</technical_language>

Target:
public boolean process(Exchange exchange, AsyncCallback callback) { final Message in = exchange.getIn(); final Message out = exchange.getOut(); String firebaseKey = (String) in.getHeader(endpoint.getKeyName()); Object value = in.getBody(); DatabaseReference ref = FirebaseDatabase .getInstance(endpoint.getFirebaseApp()) .getReference(rootReference).child(firebaseKey); final boolean reply = endpoint.isReply(); out.setHeaders(in.getHeaders()); if (reply) { processReply(exchange, callback, value, ref); } else { ref.setValue(value); out.setBody(in.getBody()); callback.done(true); } return !reply; }
Source:
<code>public void testCreatePayment() { Account account = new Account("GATEWAY_ACCOUNT_ID", TokenPaymentType.CARD); CreatePaymentRequest requestPayload = new CreatePaymentRequest(100, "<LINK_1>", "a reference", "a description"); <START> createPaymentService.invoke(account, requestPayload); <END> }</code><technical_language>good some assertions...</technical_language>

Target:
public void testCreatePayment() { Account account = new Account("GATEWAY_ACCOUNT_ID", TokenPaymentType.CARD); CreatePaymentRequest requestPayload = new CreatePaymentRequest(100, "<LINK_1>", "a reference", "a description"); PaymentWithAllLinks paymentResponse = createPaymentService.create(account, requestPayload); assertThat(paymentResponse.getPayment().getPaymentId(), is("ch_ab2341da231434l")); assertThat(paymentResponse.getPayment().getAmount(), is(100L)); assertThat(paymentResponse.getPayment().getReference(), is("a reference")); assertThat(paymentResponse.getPayment().getDescription(), is("a description")); assertThat(paymentResponse.getPayment().getEmail(), is(nullValue())); assertThat(paymentResponse.getPayment().getState(), is(new PaymentState("created", false))); assertThat(paymentResponse.getPayment().getReturnUrl(), is("<LINK_1>")); assertThat(paymentResponse.getPayment().getPaymentProvider(), is("Sandbox")); assertThat(paymentResponse.getPayment().getCreatedDate(), is("2016-01-01T12:00:00Z")); assertThat(paymentResponse.getLinks().getSelf(), is(new Link("<LINK_0>", "GET"))); assertThat(paymentResponse.getLinks().getNextUrl(), is(new Link("http://frontend_connector/charge/token_1234567asdf", "GET"))); PostLink expectedLink = new PostLink("http://frontend_connector/charge/", "POST", "application/x-www-form-urlencoded", Collections.singletonMap("chargeTokenId", "token_1234567asdf")); assertThat(paymentResponse.getLinks().getNextUrlPost(), is(expectedLink)); }
Source:
<code>private void addShowTextItem(final Menu menu) { final MenuItem showtextMenuItem = new MenuItem(menu, SWT.CHECK); showtextMenuItem.setText(WorkbenchMessages.PerspectiveBar_showText); showtextMenuItem.addSelectionListener(widgetSelectedAdapter(e -> { boolean preference = showtextMenuItem.getSelection(); if (preference != PrefUtil.getAPIPreferenceStore().getDefaultBoolean( IWorkbenchPreferenceConstants.SHOW_TEXT_ON_PERSPECTIVE_BAR)) { <START> PrefUtil.getInternalPreferenceStore().setValue( <END> IPreferenceConstants.OVERRIDE_PRESENTATION, true); } PrefUtil.getAPIPreferenceStore().setValue( IWorkbenchPreferenceConstants.SHOW_TEXT_ON_PERSPECTIVE_BAR, preference); changeShowText(preference); })); showtextMenuItem.setSelection(PrefUtil.getAPIPreferenceStore().getBoolean( IWorkbenchPreferenceConstants.SHOW_TEXT_ON_PERSPECTIVE_BAR)); }</code><technical_language>Format block</technical_language>

Target:
private void addShowTextItem(final Menu menu) { final MenuItem showtextMenuItem = new MenuItem(menu, SWT.CHECK); showtextMenuItem.setText(WorkbenchMessages.PerspectiveBar_showText); String showTextOnPerspectiveBarPreference = IWorkbenchPreferenceConstants.SHOW_TEXT_ON_PERSPECTIVE_BAR; showtextMenuItem.addSelectionListener(widgetSelectedAdapter(e -> { boolean preference = showtextMenuItem.getSelection(); IPreferenceStore apiPreferenceStore = PrefUtil.getAPIPreferenceStore(); if (preference != apiPreferenceStore.getDefaultBoolean(showTextOnPerspectiveBarPreference)) { PrefUtil.getInternalPreferenceStore().setValue(IPreferenceConstants.OVERRIDE_PRESENTATION, true); } apiPreferenceStore.setValue(showTextOnPerspectiveBarPreference, preference); changeShowText(preference); })); showtextMenuItem.setSelection(PrefUtil.getAPIPreferenceStore().getBoolean(showTextOnPerspectiveBarPreference)); }
Source:
<code>private void setupGetNewSensorTest(final Metrics metrics, final String level, final RecordingLevel recordingLevel) { <START> final String fullSensorName = INTERNAL_PREFIX + SENSOR_PREFIX_DELIMITER + level + SENSOR_NAME_DELIMITER + sensorName1; <END> expect(metrics.getSensor(fullSensorName)).andStubReturn(null); final Sensor[] parents = {}; expect(metrics.sensor(fullSensorName, recordingLevel, parents)).andReturn(sensor); replay(metrics); }</code><technical_language>Please extract this method code is line 220</technical_language>

Target:
private void setupGetNewSensorTest(final Metrics metrics, final String level, final RecordingLevel recordingLevel) { final String fullSensorName = fullSensorName(level); expect(metrics.getSensor(fullSensorName)).andStubReturn(null); final Sensor[] parents = {}; expect(metrics.sensor(fullSensorName, recordingLevel, parents)).andReturn(sensor); replay(metrics); }
Source:
<code>private void visitSwitchInsn(final Label dflt, final Label[] labels) { visitInsn(); LabelInfo.resetDone(labels); int branch = 0; jumps.add(new Jump(lastInsn, dflt, branch)); LabelInfo.setDone(dflt); for (final Label l : labels) { branch++; if (!LabelInfo.isDone(l)) { <START> jumps.add(new Jump(lastInsn, l, branch)); <END> LabelInfo.setDone(l); } } }</code><technical_language>this moved if block: purpose of check is combine identical jump targets. needed create a separate id Jump is created</technical_language>

Target:
private void visitSwitchInsn(final Label dflt, final Label[] labels) { visitInsn(); LabelInfo.resetDone(labels); int branch = 0; jumps.add(new Jump(lastInsn, dflt, branch)); LabelInfo.setDone(dflt); for (final Label l : labels) { if (!LabelInfo.isDone(l)) { branch++; jumps.add(new Jump(lastInsn, l, branch)); LabelInfo.setDone(l); } } }
Source:
<code>public EntityImage(Image base, Image wreck, int tint, Image camo, Component comp, Entity entity, int secondaryPos, boolean preview) { this.base = base; this.tint = tint; this.camo = camo; parent = comp; this.wreck = wreck; this.dmgLevel = entity.getDamageLevel(); this.weight = entity.getWeight(); isInfantry = entity instanceof Infantry; isSecondaryPos = secondaryPos != 0 && secondaryPos != -1; isPreview = preview; <START> isSlim = entity instanceof Tank || entity instanceof Aero; <END> isVerySlim = entity instanceof VTOL; }</code><technical_language>Is a of determining this based unit image (without crazy computations)? e.g. checking width/height? A Demolisher tank warrant smoke stacks, while a Maultier APC needs one</technical_language>

Target:
public EntityImage(Image base, Image wreck, int tint, Image camo, Component comp, Entity entity, int secondaryPos, boolean preview) { this.base = base; this.tint = tint; this.camo = camo; parent = comp; this.wreck = wreck; this.dmgLevel = entity.getDamageLevel(); this.weight = entity.getWeight(); isInfantry = entity instanceof Infantry; isPreview = preview; isSlim = entity instanceof Tank || entity instanceof Aero; isVerySlim = entity instanceof VTOL; pos = secondaryPos; isSingleHex = secondaryPos == -1; decal = getDamageDecal(entity, secondaryPos); smoke = getSmokeImage(entity, secondaryPos); }
Source:
<code>public void defaultSharedPreferences() throws Exception { final String KEY = "app_language_selection_pref_key"; final String DATA = "us-en"; SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context); sharedPreferences.edit().putString("foo", "bar").commit(); SharedPreferences anotherSharedPreferences = PreferenceManager.getDefaultSharedPreferences(context); String restored = anotherSharedPreferences.getString("foo", null); <START> assertThat(restored).isEqualTo(restored); <END> }</code><technical_language>this read assertThat(restored).isEqualTo("bar");</technical_language>

Target:
public void defaultSharedPreferences() throws Exception { SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context); sharedPreferences.edit().putString("foo", "bar").commit(); SharedPreferences anotherSharedPreferences = PreferenceManager.getDefaultSharedPreferences(context); String restored = anotherSharedPreferences.getString("foo", null); assertThat(restored).isEqualTo("bar"); }
Source:
<code>public void register_with_invalid_request() throws InterruptedException, IOException { helper.assertClientNotRegisterered(); Request coapRequest = new Request(Code.POST); coapRequest.setDestination(helper.server.getNonSecureAddress().getAddress()); coapRequest.setDestinationPort(helper.server.getNonSecureAddress().getPort()); coapRequest.getOptions().setContentFormat(ContentFormat.LINK.getCode()); coapRequest.getOptions().addUriPath("rd"); coapRequest.getOptions().addUriQuery("ep=" + helper.currentEndpointIdentifier); CoapEndpoint coapEndpoint = new CoapEndpoint(new InetSocketAddress(0)); coapEndpoint.start(); coapEndpoint.sendRequest(coapRequest); Response response = coapRequest.waitForResponse(1000); assertEquals(response.getCode(), org.eclipse.californium.core.coap.CoAP.ResponseCode.BAD_REQUEST); <START> System.out.println(response.getPayloadString()); <END> coapEndpoint.stop(); }</code><technical_language>sysout</technical_language>

Target:
public void register_with_invalid_request() throws InterruptedException, IOException { helper.assertClientNotRegisterered(); Request coapRequest = new Request(Code.POST); coapRequest.setDestination(helper.server.getNonSecureAddress().getAddress()); coapRequest.setDestinationPort(helper.server.getNonSecureAddress().getPort()); coapRequest.getOptions().setContentFormat(ContentFormat.LINK.getCode()); coapRequest.getOptions().addUriPath("rd"); coapRequest.getOptions().addUriQuery("ep=" + helper.currentEndpointIdentifier); CoapEndpoint coapEndpoint = new CoapEndpoint(new InetSocketAddress(0)); coapEndpoint.start(); coapEndpoint.sendRequest(coapRequest); Response response = coapRequest.waitForResponse(1000); assertEquals(response.getCode(), org.eclipse.californium.core.coap.CoAP.ResponseCode.BAD_REQUEST); coapEndpoint.stop(); }
Source:
<code>public OperationResult<List<String>> d_mget(final String... keys) { if (CompressionStrategy.NONE == connPool.getConfiguration().getCompressionStrategy()) { <START> return connPool.executeWithFailover(new MultiKeyOperation<List<String>>(new ArrayList<String>(Arrays.asList(keys)), OpName.MGET) { <END> @Override public List<String> execute(Jedis client, ConnectionContext state) { return client.mget(keys); } }); } else { return connPool.executeWithFailover(new CompressionValueMultiKeyOperation<List<String>>(new ArrayList<String>(Arrays.asList(keys)), OpName.MGET) { @Override public List<String> execute(final Jedis client, final ConnectionContext state) throws DynoException { return new ArrayList<String>(CollectionUtils.transform(client.mget(keys), new CollectionUtils.Transform<String, String>() { @Override public String get(String s) { return decompressValue(s, state); } })); } }); } }</code><technical_language>new ArrayList<String>() is unnecessary Arrays.asList() is return List<String></technical_language>

Target:
public OperationResult<List<String>> d_mget(final String... keys) { if (CompressionStrategy.NONE == connPool.getConfiguration().getCompressionStrategy()) { return connPool.executeWithFailover(new MultiKeyOperation<List<String>>(Arrays.asList(keys), OpName.MGET) { @Override public List<String> execute(Jedis client, ConnectionContext state) { return client.mget(keys); } }); } else { return connPool.executeWithFailover(new CompressionValueMultiKeyOperation<List<String>>(Arrays.asList(keys), OpName.MGET) { @Override public List<String> execute(final Jedis client, final ConnectionContext state) throws DynoException { return new ArrayList<String>(CollectionUtils.transform(client.mget(keys), new CollectionUtils.Transform<String, String>() { @Override public String get(String s) { return decompressValue(s, state); } })); } }); } }
Source:
<code>public long size() { <START> return cacheHash.size(); <END> }</code><technical_language>change a return type int</technical_language>

Target:
public int size() { return conflictKeys.size(); }
Source:
<code>public static void initialize() { if (INITIALIZED) { return; } INITIALIZED = true; <START> final String pack = "org.spongepowered.common.launch.transformer.tracker."; <END> Launch.classLoader.addTransformerExclusion(pack); Launch.classLoader.registerTransformer(pack + "TrackerClassTransformer"); }</code><technical_language>inline constant</technical_language>

Target:
public static void initialize() { if (initialized) { return; } initialized = true; Launch.classLoader.addTransformerExclusion("org.spongepowered.common.launch.transformer.tracker."); Launch.classLoader.registerTransformer("org.spongepowered.common.launch.transformer.tracker.TrackerClassTransformer"); }
Source:
<code>public void testCastWithJsonParse() { assertCastWithJsonParse("[[1,1], [2,2]]", "ARRAY<ARRAY<INTEGER>>", new ArrayType(new ArrayType(INTEGER)), ImmutableList.of(ImmutableList.of(1, 1), ImmutableList.of(2, 2))); assertInvalidCastWithJsonParse("[1, false]", "ARRAY<INTEGER>", INVALID_CAST_ARGUMENT); assertCastWithJsonParse("{\"a\"\n:1, \"b\":\t2}", "MAP<VARCHAR,INTEGER>", mapType(VARCHAR, INTEGER), ImmutableMap.of("a", 1, "b", 2)); assertInvalidCastWithJsonParse("{\"[1, 1]\":[2, 2]}", "MAP<ARRAY<INTEGER>,ARRAY<INTEGER>>", INVALID_CAST_ARGUMENT); <START> assertInvalidCastWithJsonParse("{true: false, false:false}", "MAP<BOOLEAN,BOOLEAN>", INVALID_CAST_ARGUMENT); <END> }</code><technical_language>Include error messages in test</technical_language>

Target:
public void testCastWithJsonParse() { assertCastWithJsonParse("[[1,1], [2,2]]", "ARRAY<ARRAY<INTEGER>>", new ArrayType(new ArrayType(INTEGER)), ImmutableList.of(ImmutableList.of(1, 1), ImmutableList.of(2, 2))); assertInvalidCastWithJsonParse("[1, \"abc\"]", "ARRAY<INTEGER>", INVALID_CAST_ARGUMENT, "Cannot cast to array(integer)"); assertCastWithJsonParse("{\"a\"\n:1, \"b\":\t2}", "MAP<VARCHAR,INTEGER>", mapType(VARCHAR, INTEGER), ImmutableMap.of("a", 1, "b", 2)); assertInvalidCastWithJsonParse("{\"[1, 1]\":[2, 2]}", "MAP<ARRAY<INTEGER>,ARRAY<INTEGER>>", INVALID_CAST_ARGUMENT, "Cannot cast JSON to map(array(integer),array(integer))"); assertInvalidCastWithJsonParse("{true: false, false:false}", "MAP<BOOLEAN,BOOLEAN>", INVALID_CAST_ARGUMENT, "Cannot cast to map(boolean,boolean)"); }
Source:
<code>SourceDescriptionFile(File sourceDescriptionFile, ResourceSyncUriHelper uriHelper) throws ResourceSyncException { <START> xmlHelper = new ResourceSyncXmlHelper(sourceDescriptionFile, this::updateMetaData); <END> this.uriHelper = uriHelper; }</code><technical_language>I a bit opaque constructor metadata updated. means placing constructor in of publuc api methods of this class metadata updated method is called</technical_language>

Target:
SourceDescriptionFile(File sourceDescriptionFile, ResourceSyncUriHelper uriHelper) throws ResourceSyncException { this.uriHelper = uriHelper; this.xmlHelper = new ResourceSyncXmlHelper(sourceDescriptionFile); xmlHelper.getOrCreateMetadataNode().setAttribute("capability", "description"); }
Source:
<code>public void testSpelUnauthorizedType2() throws ValidationException { <START> SpelValidator validator = new SpelValidator("T(java.lang.Runtime).getRuntime().exec('sleep 100') instanceof T(Integer)"); <END> String value = "MyString123"; validator.validate(value, new ModelValidatorContext(context)); }</code><technical_language>forget waitFor</technical_language>

Target:
public void testSpelUnauthorizedType2() throws ValidationException { SpelValidator validator = new SpelValidator("T(java.lang.Runtime).getRuntime().exec('hostname').waitFor() instanceof T(Integer)"); String value = "MyString123"; validator.validate(value, new ModelValidatorContext(context)); }