auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void onHandleIntent(@Nullable Intent intent) { Log.d(TAG, "Starting File upload service"); resources = getResources(); if (intent != null) { Operation operation = (Operation) intent.getExtras().getSerializable(resources. getString(R.string.intent_extra_operation_object)); try { uploadFile(operation); } catch (AndroidAgentException e) { Log.d(TAG, e.getLocalizedMessage()); } } this.stopSelf(); }

Target:
protected void onHandleIntent(@Nullable Intent intent) { if (Constants.DEBUG_MODE_ENABLED) { Log.d(TAG, "Starting File upload service"); } resources = getResources(); if (intent != null) { Operation operation = (Operation) intent.getExtras().getSerializable(resources. getString(R.string.intent_extra_operation_object)); try { uploadFile(operation); } catch (AndroidAgentException e) { Log.e(TAG, e.getLocalizedMessage()); } } this.stopSelf(); }
Source:
public long getDb_generation() { return db_generation; }

Target:
public Long getDb_generation() { return db_generation; }
Source:
public Response putMultipart(final MultipartAttachmentWriter mpw) { Map<String, Object> options = new HashMap<String, Object>(); options.put("new_edits", "false"); URI uri = this.uriHelper.documentUri(mpw.getId(), options); HashMap<String, String> headers = new HashMap<String, String>(); String contentType = "multipart/related;boundary=" + mpw.getBoundary(); HttpConnection connection = Http.PUT(contentType, uri); connection.setInput(mpw, mpw.getContentLength()); try { InputStream is = connection.executeToInputStream(); return jsonHelper.fromJson(new InputStreamReader(is), Response.class); } catch (IOException ioe) { return null; } }

Target:
public Response putMultipart(final MultipartAttachmentWriter mpw) { Map<String, Object> options = new HashMap<String, Object>(); options.put("new_edits", "false"); URI uri = this.uriHelper.documentUri(mpw.getId(), options); String contentType = "multipart/related;boundary=" + mpw.getBoundary(); HttpConnection connection = Http.PUT(uri, contentType); connection.setRequestBody(mpw, mpw.getContentLength()); return executeToJsonObject(connection, Response.class); }
Source:
public void testEncounter_latestEncounterIsAlwaysShown() { inUserLoginGoToDemoPatientChart(); for (int i = 0; i < 6; i++) { openEncounterForm(); String temp = Integer.toString(i + 35); String respiratoryRate = Integer.toString(i + 80); String bpSystolic = Integer.toString(i + 80); String bpDiastolic = Integer.toString(5 + 100); answerTextQuestion("Temperature", temp); answerTextQuestion("Respiratory rate", respiratoryRate); answerTextQuestion("Blood pressure, systolic", bpSystolic); answerTextQuestion("Blood pressure, diastolic", bpDiastolic); saveForm(); waitForProgressFragment(); try{ Thread.sleep(20000); } catch (InterruptedException e){} checkObservationValueEquals("[test] Temperature (°C)", temp); checkObservationValueEquals("[test] Respiratory rate (bpm)", respiratoryRate); checkObservationValueEquals("[test] Blood pressure, systolic", bpSystolic); checkObservationValueEquals("[test] Blood pressure, diastolic", bpDiastolic); } }

Target:
public void testEncounter_latestEncounterIsAlwaysShown() { inUserLoginGoToDemoPatientChart(); for (int i = 0; i < 6; i++) { openEncounterForm(); String temp = Integer.toString(i + 35) + ".7"; String respiratoryRate = Integer.toString(i + 80); String bpSystolic = Integer.toString(i + 80); String bpDiastolic = Integer.toString(i + 100); answerTextQuestion("Temperature", temp); answerTextQuestion("Respiratory rate", respiratoryRate); answerTextQuestion("Blood pressure, systolic", bpSystolic); answerTextQuestion("Blood pressure, diastolic", bpDiastolic); saveForm(); waitForProgressFragment(); try{ Thread.sleep(30000); } catch (InterruptedException e){} checkObservationValueEquals("[test] Temperature (°C)", temp); checkObservationValueEquals("[test] Respiratory rate (bpm)", respiratoryRate); checkObservationValueEquals("[test] Blood pressure, systolic", bpSystolic); checkObservationValueEquals("[test] Blood pressure, diastolic", bpDiastolic); } }
Source:
public void testIOConsoleAvailable() throws Exception { IOConsole console = new IOConsole("", null); try (InputStream consoleInput = console.getInputStream()) { consoleInput.available(); consoleInput.available(); } catch (IOException ioe) { TestCase.assertEquals("Input Stream is closed", ioe.getMessage()); } console = new IOConsole("", null); try (InputStream consoleInput = console.getInputStream()) { consoleInput.available(); new Thread(() -> { try { Thread.sleep(100); consoleInput.close(); } catch (Exception e) { } }).start(); assertEquals("read() did not signaled EOF.", -1, consoleInput.read()); } console = new IOConsole("", null); try (InputStream consoleInput = console.getInputStream()) { consoleInput.close(); boolean second = false; try { consoleInput.available(); second = true; consoleInput.available(); } catch (IOException ioe) { assertFalse("Second available() after close() thrown exception. Either both or non should fail.", second); } } }

Target:
public void testIOConsoleAvailable() throws Exception { IOConsole console = new IOConsole("", null); try (InputStream consoleInput = console.getInputStream()) { consoleInput.available(); consoleInput.available(); } console = new IOConsole("", null); try (InputStream consoleInput = console.getInputStream()) { consoleInput.available(); new Thread(() -> { try { Thread.sleep(100); consoleInput.close(); } catch (Exception e) { } }).start(); assertEquals("read() did not signaled EOF.", -1, consoleInput.read()); } console = new IOConsole("", null); try (InputStream consoleInput = console.getInputStream()) { consoleInput.close(); consoleInput.available(); consoleInput.available(); } }
Source:
public DeniedAccess(Map<URI, Collection<String>> conflicts) { assert !conflicts.isEmpty() : "the conflict map should not be empty"; this.conflicts = conflicts; }

Target:
public DeniedAccess(Map<URI, Collection<String>> conflicts) { if (conflicts.isEmpty()) { throw new IllegalArgumentException("the conflict map should not be empty"); } this.conflicts = conflicts; }
Source:
private Object executeQuery(Object entity, String queryString, Map<String, Object> params, MappingPolicy mappingPolicy) { final TypeInformation<?> typeInformation = property.getTypeInformation(); final TypeInformation<?> actualType = typeInformation.getActualType(); final Class<?> targetType = actualType.getType(); final Result<Map<String, Object>> result = queryEngine.query(queryString, params).with(mappingPolicy); if (actualType.isMap()) { return result; } if (typeInformation.isCollectionLike()) { return CollectionLikeQueryResultExtractionUtil.extractCollectionLikeResult(result, targetType, typeInformation.getType()); } return result.to(targetType).singleOrNull(); }

Target:
private Object executeQuery(Object entity, String queryString, Map<String, Object> params, MappingPolicy mappingPolicy) { final TypeInformation<?> typeInformation = property.getTypeInformation(); final TypeInformation<?> actualType = typeInformation.getActualType(); final Class<?> targetType = actualType.getType(); final Result<Map<String, Object>> result = queryEngine.query(queryString, params).with(mappingPolicy); if (actualType.isMap()) { return result; } return (typeInformation.isCollectionLike()) ? result.to(targetType).asCollection((Class<? extends Iterable>)typeInformation.getType()) : result.to(targetType).singleOrNull(); }
Source:
Comparator<TimeAndDims> dimsComparator() { return new TimeAndDimsComp(); }

Target:
protected final Comparator<TimeAndDims> dimsComparator() { return new TimeAndDimsComp(dimValues); }
Source:
private boolean checkFourLetterWord(final SelectionKey k, final int len) throws IOException { String cmd = FourLetterCommands.getCmdMapView().get(len); if (cmd == null || !FourLetterCommands.getWhiteListedCmdView().contains(cmd)) { return false; } LOG.info("Processing " + cmd + " command from " + sock.socket().getRemoteSocketAddress()); packetReceived(); if (k != null) { try { k.cancel(); } catch(Exception e) { LOG.error("Error cancelling command selection key ", e); } } final PrintWriter pwriter = new PrintWriter( new BufferedWriter(new SendBufferWriter())); if (len == FourLetterCommands.setTraceMaskCmd) { incomingBuffer = ByteBuffer.allocate(8); int rc = sock.read(incomingBuffer); if (rc < 0) { throw new IOException("Read error"); } incomingBuffer.flip(); long traceMask = incomingBuffer.getLong(); ZooTrace.setTextTraceLevel(traceMask); SetTraceMaskCommand setMask = new SetTraceMaskCommand(pwriter, this, traceMask); setMask.start(); return true; } else { CommandExecutor commandExecutor = new CommandExecutor(); return commandExecutor.execute(this, pwriter, len, zkServer, factory); } }

Target:
private boolean checkFourLetterWord(final SelectionKey k, final int len) throws IOException { if (!FourLetterCommands.isKnown(len)) { return false; } String cmd = FourLetterCommands.getCommandString(len); packetReceived(); if (k != null) { try { k.cancel(); } catch(Exception e) { LOG.error("Error cancelling command selection key ", e); } } final PrintWriter pwriter = new PrintWriter( new BufferedWriter(new SendBufferWriter())); if (!FourLetterCommands.isEnabled(cmd)) { LOG.debug("Command is not executed because it is not in the whitelist.", cmd); NopCommand nopCmd = new NopCommand(pwriter, this, cmd + " is not executed because it is not in the whitelist."); nopCmd.start(); return true; } LOG.info("Processing " + cmd + " command from " + sock.socket().getRemoteSocketAddress()); if (len == FourLetterCommands.setTraceMaskCmd) { incomingBuffer = ByteBuffer.allocate(8); int rc = sock.read(incomingBuffer); if (rc < 0) { throw new IOException("Read error"); } incomingBuffer.flip(); long traceMask = incomingBuffer.getLong(); ZooTrace.setTextTraceLevel(traceMask); SetTraceMaskCommand setMask = new SetTraceMaskCommand(pwriter, this, traceMask); setMask.start(); return true; } else { CommandExecutor commandExecutor = new CommandExecutor(); return commandExecutor.execute(this, pwriter, len, zkServer, factory); } }
Source:
public int getSupportedFeatureSet() { int featureSet = 0; try { final MutableInt feat = new MutableInt(0); synchronized (sLock) { if (mIWifiStaIface != null) { mIWifiStaIface.getCapabilities((status, capabilities) -> { if (status.code != WifiStatusCode.SUCCESS) return; feat.value = wifiFeatureMaskFromStaCapabilities(capabilities); }); } } featureSet = feat.value; } catch (RemoteException e) { handleRemoteException(e); return 0; } Set<Integer> supportedIfaceTypes = mHalDeviceManager.getSupportedIfaceTypes(); if (supportedIfaceTypes.contains(IfaceType.AP)) { featureSet |= WifiManager.WIFI_FEATURE_MOBILE_HOTSPOT; } if (supportedIfaceTypes.contains(IfaceType.P2P)) { featureSet |= WifiManager.WIFI_FEATURE_P2P; } if (supportedIfaceTypes.contains(IfaceType.NAN)) { featureSet |= WifiManager.WIFI_FEATURE_AWARE; } return featureSet; }

Target:
public int getSupportedFeatureSet() { int featureSet = 0; try { final MutableInt feat = new MutableInt(0); synchronized (sLock) { if (mIWifiStaIface != null) { mIWifiStaIface.getCapabilities((status, capabilities) -> { if (status.code != WifiStatusCode.SUCCESS) return; feat.value = wifiFeatureMaskFromStaCapabilities(capabilities); }); } } featureSet = feat.value; } catch (RemoteException e) { handleRemoteException(e); return 0; } Set<Integer> supportedIfaceTypes = mHalDeviceManager.getSupportedIfaceTypes(); if (supportedIfaceTypes.contains(IfaceType.STA)) { featureSet |= WifiManager.WIFI_FEATURE_INFRA; } if (supportedIfaceTypes.contains(IfaceType.AP)) { featureSet |= WifiManager.WIFI_FEATURE_MOBILE_HOTSPOT; } if (supportedIfaceTypes.contains(IfaceType.P2P)) { featureSet |= WifiManager.WIFI_FEATURE_P2P; } if (supportedIfaceTypes.contains(IfaceType.NAN)) { featureSet |= WifiManager.WIFI_FEATURE_AWARE; } return featureSet; }
Source:
private static CommonCourtJudgment createCcJudgmentWithRandomData(String prefix, int numericPrefix){ CommonCourtJudgment ccJudgment = new CommonCourtJudgment(); TestInMemoryObjectFactoryHelper.fillJudgmentWithRandomData(ccJudgment, prefix, numericPrefix); ccJudgment.getSourceInfo().setSourceCode(SourceCode.COMMON_COURT); ccJudgment.getSourceInfo().setSourceJudgmentId(prefix+RandomStringUtils.randomAlphabetic(20)); ccJudgment.getSourceInfo().setSourceJudgmentUrl("<LINK_0>" + RandomStringUtils.randomAlphabetic(20)); CcJudgmentKeyword firstKeyword = new CcJudgmentKeyword(RandomStringUtils.randomAlphanumeric(18)); CcJudgmentKeyword secondKeyword = new CcJudgmentKeyword(RandomStringUtils.randomAlphanumeric(19)); ccJudgment.addKeyword(firstKeyword); ccJudgment.addKeyword(secondKeyword); return ccJudgment; }

Target:
private static CommonCourtJudgment createCcJudgmentWithRandomData(String prefix, int numericPrefix){ CommonCourtJudgment ccJudgment = new CommonCourtJudgment(); TestInMemoryObjectFactoryHelper.fillJudgmentWithRandomData(ccJudgment, prefix, numericPrefix); ccJudgment.getSourceInfo().setSourceCode(SourceCode.COMMON_COURT); CcJudgmentKeyword firstKeyword = new CcJudgmentKeyword(RandomStringUtils.randomAlphanumeric(18)); CcJudgmentKeyword secondKeyword = new CcJudgmentKeyword(RandomStringUtils.randomAlphanumeric(19)); ccJudgment.addKeyword(firstKeyword); ccJudgment.addKeyword(secondKeyword); return ccJudgment; }
Source:
protected void configure() { bind(DataSource.class).toProvider(org.eclipse.che.core.db.JndiDataSourceProvider.class); bind(org.eclipse.che.api.system.server.SystemServicePermissionsFilter.class); install(new SystemPermissionsJpaModule()); install(new org.eclipse.che.api.permission.server.PermissionsModule()); install(new org.eclipse.che.api.workspace.server.WorkspaceApiPermissionsModule()); bind(UserProfileServicePermissionsFilter.class); bind(UserServicePermissionsFilter.class); bind(FactoryPermissionsFilter.class); bind(ActivityPermissionsFilter.class); bindConstant().annotatedWith(Names.named("system.super_privileged_mode")).to(false); Multibinder.newSetBinder(binder(), AccountPermissionsChecker.class) .addBinding() .to(PersonalAccountPermissionsChecker.class); }

Target:
protected void configure() { bind(DataSource.class).toProvider(org.eclipse.che.core.db.JndiDataSourceProvider.class); bind(org.eclipse.che.api.system.server.SystemServicePermissionsFilter.class); install(new org.eclipse.che.api.permission.server.jpa.SystemPermissionsJpaModule()); install(new org.eclipse.che.api.permission.server.PermissionsModule()); install(new org.eclipse.che.api.workspace.server.WorkspaceApiPermissionsModule()); bind(org.eclipse.che.api.user.server.permissions.UserProfileServicePermissionsFilter.class); bind(org.eclipse.che.api.user.server.permissions.UserServicePermissionsFilter.class); bind(org.eclipse.che.api.factory.server.permissions.FactoryPermissionsFilter.class); bind(org.eclipse.che.plugin.activity.ActivityPermissionsFilter.class); Multibinder.newSetBinder(binder(), AccountPermissionsChecker.class) .addBinding() .to(org.eclipse.che.account.permission.PersonalAccountPermissionsChecker.class); }
Source:
public static OctoInstallation[] getOctopusToolInstallations() { Jenkins jenkins = Jenkins.getInstanceOrNull(); if (jenkins == null) { throw new NullPointerException("Jenkins instance not found"); } OctoInstallation.DescriptorImpl descriptor = (OctoInstallation.DescriptorImpl) jenkins.getDescriptor(OctoInstallation.class); return descriptor.getInstallations(); }

Target:
public static OctoInstallation[] getOctopusToolInstallations() { Jenkins jenkins = JenkinsHelpers.getJenkins(); OctoInstallation.DescriptorImpl descriptor = (OctoInstallation.DescriptorImpl) jenkins.getDescriptor(OctoInstallation.class); return descriptor.getInstallations(); }
Source:
public String getProviderType() { return osUser.getProviderType(); }

Target:
public Credentials.IdentityProvider getProviderType() { return Credentials.IdentityProvider.fromId(osUser.getProviderType()); }
Source:
@Test void testEmptyValuesWithCollation() throws Exception { final RelBuilder builder = RelBuilder.create(config().build()); final RelNode root = builder .scan("DEPT") .filter(builder.literal(false)) .sort( builder.field("DNAME"), builder.field("DEPTNO")) .build(); try (PreparedStatement preparedStatement = RelRunners.run(root)) { final String s = CalciteAssert.toString(preparedStatement.executeQuery()); final String result = ""; assertThat(s, is(result)); } }

Target:
@Test void testEmptyValuesWithCollation() throws Exception { final RelBuilder builder = RelBuilder.create(config().build()); final RelNode root = builder .scan("DEPT").empty() .sort( builder.field("DNAME"), builder.field("DEPTNO")) .build(); try (PreparedStatement preparedStatement = RelRunners.run(root)) { final String result = CalciteAssert.toString(preparedStatement.executeQuery()); final String expectedResult = ""; assertThat(result, is(expectedResult)); } }
Source:
List<PlanMatchingState> shapeMatches(PlanNode node) { ImmutableList.Builder<PlanMatchingState> states = ImmutableList.builder(); if (anyTree) { int sourcesCount = node.getSources().size(); if (sourcesCount > 1) { states.add(new PlanMatchingState(nCopies(sourcesCount, this))); } else { states.add(new PlanMatchingState(ImmutableList.of(this))); } } if (sources(node).size() == sourcePatterns.size() && matchers.stream().allMatch(it -> it.shapeMatches(node))) { states.add(new PlanMatchingState(sourcePatterns)); } return states.build(); }

Target:
List<PlanMatchingState> shapeMatches(PlanNode node) { ImmutableList.Builder<PlanMatchingState> states = ImmutableList.builder(); if (anyTree) { int sourcesCount = node.getSources().size(); if (sourcesCount > 1) { states.add(new PlanMatchingState(nCopies(sourcesCount, this))); } else { states.add(new PlanMatchingState(ImmutableList.of(this))); } } if (node instanceof GroupReference) { if (sourcePatterns.isEmpty() && shapeMatchesMatchers(node)) { states.add(new PlanMatchingState(ImmutableList.of())); } } else if (node.getSources().size() == sourcePatterns.size() && shapeMatchesMatchers(node)) { states.add(new PlanMatchingState(sourcePatterns)); } return states.build(); }
Source:
public void register(Class<? extends Converter<?>> converterClass) { Convert type = converterClass.getAnnotation(Convert.class); checkNotNull(type, "The converter type %s should have the Convert annotation", converterClass.getName()); logger.debug("adding converter to {}", converterClass, type.value()); classes.add(converterClass); }

Target:
public void register(Class<? extends Converter<?>> converterClass) { Convert type = converterClass.getAnnotation(Convert.class); checkState(type != null, "The converter type %s should have the Convert annotation", converterClass.getName()); logger.debug("adding converter to {}", converterClass, type.value()); classes.add(converterClass); }
Source:
public synchronized Object getObject() throws Exception { if (this.proxy == null) { this.channelFactory.createChannels(this.type); ProxyFactory factory = new ProxyFactory(this.type, this); this.proxy = factory.getProxy(); } return this.proxy; }

Target:
public synchronized Object getObject() throws Exception { if (this.proxy == null) { ProxyFactory factory = new ProxyFactory(this.type, this); this.proxy = factory.getProxy(); } return this.proxy; }
Source:
private static boolean isSoapPayload( final InputStream is ) throws IOException { String content = CharStreams.toString( new InputStreamReader( is, Charsets.UTF_8 ) ); is.reset(); return endSoapTag.matcher( content ).find(); }

Target:
private static boolean isSoapPayload(final InputStream is) throws IOException { int size = is.available(); char[] chars = new char[size]; byte[] bytes = new byte[size]; is.read(bytes, 0, size); for (int i = 0; i < size;) chars[i] = (char) (bytes[i++] & 0xff); is.reset(); return endSoapTag.matcher(new String(chars)).find(); }
Source:
private void initCinderDependentVolume(CinderDisk newCinderVolume) { newCinderVolume.setVolumeType(VolumeType.Unassigned); newCinderVolume.setvolumeFormat(VolumeFormat.UNUSED1); newCinderVolume.setImageStatus(ImageStatus.LOCKED); newCinderVolume.setParentId(getDiskImage().getImageId()); newCinderVolume.setVmSnapshotId(getParameters().getVmSnapshotId()); newCinderVolume.setCreationDate(new Date()); newCinderVolume.setLastModifiedDate(new Date()); newCinderVolume.setQuotaId(getParameters().getQuotaId()); newCinderVolume.setDiskProfileId(getParameters().getDiskProfileId()); newCinderVolume.setActive(Boolean.FALSE); }

Target:
private void initCinderDependentVolume(CinderDisk newCinderVolume) { newCinderVolume.setVolumeType(VolumeType.Unassigned); newCinderVolume.setvolumeFormat(VolumeFormat.Unassigned); newCinderVolume.setImageStatus(ImageStatus.LOCKED); newCinderVolume.setParentId(getDiskImage().getImageId()); newCinderVolume.setVmSnapshotId(getParameters().getVmSnapshotId()); newCinderVolume.setCreationDate(new Date()); newCinderVolume.setLastModifiedDate(new Date()); newCinderVolume.setQuotaId(getParameters().getQuotaId()); newCinderVolume.setDiskProfileId(getParameters().getDiskProfileId()); newCinderVolume.setActive(Boolean.FALSE); }
Source:
private float[][] calculateRubricStats(List<FeedbackResponseAttributes> responses, FeedbackRubricQuestionDetails fqd) { int[][] responseFrequency = calculateResponseFrequency(responses, fqd); int numOfRubricChoices = fqd.numOfRubricChoices; float[][] percentageFrequencyAndAverageValue = new float[fqd.numOfRubricSubQuestions][]; for (int i = 0; i < percentageFrequencyAndAverageValue.length; i++) { percentageFrequencyAndAverageValue[i] = new float[numOfRubricChoices + 1]; for (int j = 0; j < (percentageFrequencyAndAverageValue.length + 1); j++) { percentageFrequencyAndAverageValue[i][j] = 0; } } for (int i = 0; i < percentageFrequencyAndAverageValue.length; i++) { int totalForSubQuestion = responseFrequency[i][fqd.numOfRubricChoices]; if (totalForSubQuestion == 0) { continue; } for (int j = 0; j < numOfRubricChoices; j++) { percentageFrequencyAndAverageValue[i][j] = (float) responseFrequency[i][j] / totalForSubQuestion; } if (fqd.hasAssignedWeights) { for (int j = 0; j < numOfRubricChoices; j++) { float choiceWeight = (float) (fqd.rubricWeights.get(j) * percentageFrequencyAndAverageValue[i][j]); percentageFrequencyAndAverageValue[i][numOfRubricChoices] += choiceWeight; } } } return percentageFrequencyAndAverageValue; }

Target:
private float[][] calculateRubricStats(List<FeedbackResponseAttributes> responses, FeedbackRubricQuestionDetails fqd) { int[][] responseFrequency = calculateResponseFrequency(responses, fqd); int numOfRubricChoices = fqd.numOfRubricChoices; float[][] percentageFrequencyAndAverageValue = new float[fqd.numOfRubricSubQuestions][numOfRubricChoices + 1]; for (int i = 0; i < percentageFrequencyAndAverageValue.length; i++) { int totalForSubQuestion = responseFrequency[i][fqd.numOfRubricChoices]; if (totalForSubQuestion == 0) { continue; } for (int j = 0; j < numOfRubricChoices; j++) { percentageFrequencyAndAverageValue[i][j] = (float) responseFrequency[i][j] / totalForSubQuestion; } if (fqd.hasAssignedWeights) { for (int j = 0; j < numOfRubricChoices; j++) { float choiceWeight = (float) (fqd.rubricWeights.get(j) * percentageFrequencyAndAverageValue[i][j]); percentageFrequencyAndAverageValue[i][numOfRubricChoices] += choiceWeight; } } } return percentageFrequencyAndAverageValue; }
Source:
public void updateTreeItemMappings() { Tree tree = treeViewer.getTree(); if (isDummyChild(tree.getItems())) { treeViewer.createChildren(tree); } final List<TreeNode> needCrossReferencer = new ArrayList<TreeNode>(); TreeNodeCrossReferencer crossReferencer = null; for (TreeItem root : tree.getItems()) { final TreeNode rootNode = getTreeNodeFromAdapter(root.getData()); boolean hasCrossReferencer = false; for (Adapter adapter : rootNode.eAdapters()) { if (adapter instanceof TreeNodeCrossReferencer) { crossReferencer = (TreeNodeCrossReferencer)adapter; hasCrossReferencer = true; } } if (!hasCrossReferencer) { needCrossReferencer.add(rootNode); } } if (crossReferencer == null) { crossReferencer = new TreeNodeCrossReferencer(); } for (TreeNode needy : needCrossReferencer) { needy.eAdapters().add(crossReferencer); } treeNodeToDiffCrossReferencer = crossReferencer; }

Target:
public void updateTreeItemMappings() { Tree tree = treeViewer.getTree(); if (isDummyChild(tree.getItems())) { treeViewer.createChildren(tree); } final List<TreeNode> needCrossReferencer = new ArrayList<TreeNode>(); TreeNodeCrossReferencer crossReferencer = null; for (TreeItem root : tree.getItems()) { final TreeNode rootNode = getTreeNodeFromAdapter(root.getData()); final Adapter adapter = EcoreUtil.getExistingAdapter(rootNode, TreeNodeCrossReferencer.class); if (adapter instanceof TreeNodeCrossReferencer) { crossReferencer = (TreeNodeCrossReferencer)adapter; } else { needCrossReferencer.add(rootNode); } } if (crossReferencer == null) { crossReferencer = new TreeNodeCrossReferencer(); } for (TreeNode needy : needCrossReferencer) { needy.eAdapters().add(crossReferencer); } treeNodeToDiffCrossReferencer = crossReferencer; }
Source:
RowSerializerSnapshot(RowSerializer serializerInstance) { super(serializerInstance); this.readVersion = serializerInstance.legacyModeEnabled ? LAST_VERSION_WITHOUT_ROW_KIND : VERSION; }

Target:
RowSerializerSnapshot(RowSerializer serializerInstance) { super(serializerInstance); }
Source:
private void alterFormElementName(FormElement formElement) { String formFieldName = formElement.getName(); String name = formFieldName.substring(formFieldName.indexOf("/", 1) + 1, formFieldName.length()); formElement.setName(name); if (formElement.hasChildren()) { for (FormElement child : formElement.getChildren()) { alterFormElementName(child); } } }

Target:
private void alterFormElementName(FormElement formElement) throws MalformedUriException { String formFieldName = formElement.getName(); String name = FormUtils.removeTitleFromUri(formFieldName); formElement.setName(name); if (formElement.hasChildren()) { for (FormElement child : formElement.getChildren()) { alterFormElementName(child); } } }
Source:
public int hashCode() { if (getInput(false) != null) { return getInput(false).hashCode(); } return super.hashCode(); }

Target:
public int hashCode() { EObject input = getInput(false); if (input != null) { return input.hashCode(); } return super.hashCode(); }
Source:
private void checkMethodNamingPattern(DetailAST methodDefToken) { final DetailAST modifiersToken = methodDefToken.findFirstToken(TokenTypes.MODIFIERS); final Optional<DetailAST> serviceMethodAnnotationOption = TokenUtil.findFirstTokenByPredicate(modifiersToken, node -> { if (node.getType() != TokenTypes.ANNOTATION) { return false; } final DetailAST annotationIdentToken = node.findFirstToken(TokenTypes.IDENT); return annotationIdentToken != null && "ServiceMethod".equals(annotationIdentToken.getText()); }); if (!serviceMethodAnnotationOption.isPresent()) { return; } final DetailAST serviceMethodAnnotation = serviceMethodAnnotationOption.get(); final String methodName = methodDefToken.findFirstToken(TokenTypes.IDENT).getText(); final String prefix = methodName.split("[A-Z]", 2)[0]; if (!methodName.endsWith("Exists") && !COMMON_NAMING_PREFIX_SET.contains(prefix)) { log(methodDefToken, String.format("Method name ''%s'' should follow a common vocabulary. Refer to Java " + "Spec: %s.", methodName, JAVA_SPEC_LINK)); } if (methodName.contains(ASYNC)) { log(methodDefToken, String.format("Method name ''%s'' should not contain ''%s'' in the method name.", methodName, ASYNC)); } checkServiceClientMethodReturnType(methodDefToken, serviceMethodAnnotation, methodName); checkReturnTypeNamingPattern(methodDefToken, methodName); checkContextInRightPlace(methodDefToken); }

Target:
private void checkMethodNamingPattern(DetailAST methodDefToken) { final DetailAST modifiersToken = methodDefToken.findFirstToken(TokenTypes.MODIFIERS); final Optional<DetailAST> serviceMethodAnnotationOption = TokenUtil.findFirstTokenByPredicate(modifiersToken, node -> { if (node.getType() != TokenTypes.ANNOTATION) { return false; } final DetailAST annotationIdentToken = node.findFirstToken(TokenTypes.IDENT); return annotationIdentToken != null && "ServiceMethod".equals(annotationIdentToken.getText()); }); if (!serviceMethodAnnotationOption.isPresent()) { return; } final DetailAST serviceMethodAnnotation = serviceMethodAnnotationOption.get(); final String methodName = methodDefToken.findFirstToken(TokenTypes.IDENT).getText(); final String prefix = methodName.split("[A-Z]", 2)[0]; if (!methodName.endsWith("Exists") && !COMMON_NAMING_PREFIX_SET.contains(prefix)) { log(methodDefToken, String.format( "Method name ''%s'' should follow a common vocabulary. Refer to Java Spec: %s.", methodName, JAVA_SPEC_LINK)); } if (methodName.contains(ASYNC)) { log(methodDefToken, String.format("Method name ''%s'' should not contain ''%s'' in the method name.", methodName, ASYNC)); } checkServiceClientMethodReturnType(methodDefToken, serviceMethodAnnotation, methodName); checkReturnTypeNamingPattern(methodDefToken, methodName); checkContextInRightPlace(methodDefToken); }
Source:
public Map<String, Object> anyQuery(QueryBuilder query, Field<?>... fields) { try (Connection c = ds.getConnection()) { LOGGER.log(Level.FINEST, query.toString()); PreparedStatement stmt = query.toStatement(c); try { ResultSet rs = stmt.executeQuery(); try { if(rs.next()) { assert(rs.last()); Map<String, Object> result = new HashMap<String, Object>(); for(int i = 0; i< fields.length; i++) { result.put(fields[i].getFieldName(), fields[i].getValue(rs)); } return result; } else { return null; } } finally { rs.close(); } } finally { stmt.close(); } } catch (SQLException ex) { throw new IllegalStateException("SelectQuery Failed",ex); } }

Target:
public Map<String, Object> anyQuery(QueryBuilder query, Field<?>... fields) { LOGGER.log(Level.FINEST, query.toString()); try (Connection c = ds.getConnection()) { try (PreparedStatement stmt = query.toStatement(c)) { try (ResultSet rs = stmt.executeQuery()) { if (rs.next()) { assert (rs.last()); Map<String, Object> result = new HashMap<String, Object>(); for (int i = 0; i < fields.length; i++) { result.put(fields[i].getFieldName(), fields[i].getValue(rs)); } return result; } else { return null; } } } } catch (SQLException ex) { throw new IllegalStateException("SelectQuery Failed", ex); } }
Source:
public void refreshPeopleList() { if (!isAdded()) return; List<Person> peopleList = PeopleTable.getPeople(mLocalTableBlogID); PeopleAdapter peopleAdapter = (PeopleAdapter) getListAdapter(); if (peopleAdapter == null) { peopleAdapter = new PeopleAdapter(getActivity(), peopleList); setListAdapter(peopleAdapter); } else { peopleAdapter.setPeopleList(peopleList); peopleAdapter.notifyDataSetChanged(); } }

Target:
public void refreshPeopleList() { if (!isAdded()) return; List<Person> peopleList = PeopleTable.getPeople(mLocalTableBlogID); PeopleAdapter peopleAdapter = (PeopleAdapter) getListAdapter(); if (peopleAdapter == null) { peopleAdapter = new PeopleAdapter(getActivity(), peopleList); setListAdapter(peopleAdapter); } else { peopleAdapter.setPeopleList(peopleList); } }
Source:
public void callPublicMethodWithSeveralByteParams(String containerType, String endpoint) { byte value1 = 1, value2 = 2, value3 = 3; byte result = (byte)(value1 + value2 + value3); performActionForByte(containerType, endpoint, PUBLIC_WITH_SEVERAL_BYTE_PARAMS_ACTION, result, new Param(PARAM_NAME_1, value1), new Param(PARAM_NAME_2, value2), new Param(PARAM_NAME_3, value3)); }

Target:
public void callPublicMethodWithSeveralByteParams(String containerType, String endpoint) { final byte value1 = 1; final byte value2 = 2; final byte value3 = 3; final byte result = (byte)(value1 + value2 + value3); performActionForByte(containerType, endpoint, PUBLIC_WITH_SEVERAL_BYTE_PARAMS_ACTION, result, new Param(PARAM_NAME_1, value1), new Param(PARAM_NAME_2, value2), new Param(PARAM_NAME_3, value3)); }
Source:
public void participate(InstanceType role) throws Exception { manager = HelixManagerFactory.getZKHelixManager(vcrClusterName, vcrInstanceName, InstanceType.PARTICIPANT, cloudConfig.vcrClusterZkConnectString); manager.getStateMachineEngine() .registerStateModelFactory(LeaderStandbySMD.name, new HelixVcrStateModelFactory(this)); manager.connect(); helixAdmin = manager.getClusterManagmentTool(); logger.info("Participate HelixVcrCluster as successfully.", role); }

Target:
public void participate(InstanceType role) throws Exception { manager = HelixManagerFactory.getZKHelixManager(vcrClusterName, vcrInstanceName, role, cloudConfig.vcrClusterZkConnectString); manager.getStateMachineEngine() .registerStateModelFactory(LeaderStandbySMD.name, new HelixVcrStateModelFactory(this)); manager.connect(); helixAdmin = manager.getClusterManagmentTool(); logger.info("Participate HelixVcrCluster as successfully.", role); }
Source:
List<SchedulerUserInfo> getUsers() { List<SchedulerUserInfo> users = new ArrayList<>(identifications.size()); for (UserAndCredentials userAndCredentials : identifications.values()) { ListeningUser listeningUser = userAndCredentials.getListeningUser(); UserIdentificationImpl user = listeningUser.getUser(); users.add(new SchedulerUserInfo(user.getHostName(), user.getUsername(), user.getConnectionTime(), user.getLastSubmitTime(), user.getSubmitNumber())); } return users; }

Target:
List<SchedulerUserInfo> getUsers() { return identifications.values().stream().map(userAndCredentials -> { ListeningUser listeningUser = userAndCredentials.getListeningUser(); UserIdentificationImpl user = listeningUser.getUser(); return new SchedulerUserInfo(user.getHostName(), user.getUsername(), user.getConnectionTime(), user.getLastSubmitTime(), user.getSubmitNumber()); }).collect(Collectors.toList()); }
Source:
private void validate() { if (!index.getCurrencyPair().contains(referenceCurrency)) { throw new IllegalArgumentException( Messages.format("Reference currency must be one of those in the FxIndex: {}", referenceCurrency, index)); } }

Target:
private void validate() { if (!index.getCurrencyPair().contains(referenceCurrency)) { throw new IllegalArgumentException( Messages.format("Reference currency must be one of those in the FxIndex {}", referenceCurrency, index)); } }
Source:
public void mustEvaluateTrueEqualityTest() throws Exception { new Assertion<>( "Must evaluate true equality", new SiHmac( "key", SiHmac.HMAC256 ), new IsEqual<>( new SiHmac("key", SiHmac.HMAC256) ) ).affirm(); }

Target:
public void mustEvaluateTrueEqualityTest() throws Exception { final String key = "key"; new Assertion<>( "Must evaluate true equality", new SiHmac(key, SiHmac.HMAC256), new IsEqual<>(new SiHmac(key, SiHmac.HMAC256)) ).affirm(); }
Source:
public ImmutableBitmap getBitmapIndex(String dimension, String value) { final Column column = index.getColumn(dimension); if (column == null) { if (value == null || "".equals(value)) { return bitmapFactory.complement(bitmapFactory.makeEmptyImmutableBitmap(), getNumRows()); } return bitmapFactory.makeEmptyImmutableBitmap(); } if (!column.getCapabilities().hasBitmapIndexes()) { bitmapFactory.makeEmptyImmutableBitmap(); } return column.getBitmapIndex().getBitmap(value); }

Target:
public ImmutableBitmap getBitmapIndex(String dimension, String value) { final Column column = index.getColumn(dimension); if (column == null) { if (Strings.isNullOrEmpty(value)) { return bitmapFactory.complement(bitmapFactory.makeEmptyImmutableBitmap(), getNumRows()); } else { return bitmapFactory.makeEmptyImmutableBitmap(); } } if (!column.getCapabilities().hasBitmapIndexes()) { bitmapFactory.makeEmptyImmutableBitmap(); } return column.getBitmapIndex().getBitmap(value); }
Source:
public void moveGroup(PerunSession sess, Group destinationGroup, Group movingGroup) throws InternalErrorException, GroupNotExistsException, PrivilegeException, GroupMoveNotAllowedException{ Utils.checkPerunSession(sess); getGroupsManagerBl().checkGroupExists(sess, movingGroup); if(destinationGroup != null){ getGroupsManagerBl().checkGroupExists(sess, destinationGroup); } if ((!AuthzResolver.isAuthorized(sess, Role.VOADMIN, movingGroup) && !AuthzResolver.isAuthorized(sess, Role.GROUPADMIN, movingGroup)) || (!AuthzResolver.isAuthorized(sess, Role.VOADMIN, destinationGroup) && !AuthzResolver.isAuthorized(sess, Role.GROUPADMIN, destinationGroup))) { throw new PrivilegeException(sess, "moveGroup"); } getGroupsManagerBl().moveGroup(sess, destinationGroup, movingGroup); }

Target:
public void moveGroup(PerunSession sess, Group destinationGroup, Group movingGroup) throws InternalErrorException, GroupNotExistsException, PrivilegeException, GroupMoveNotAllowedException{ Utils.checkPerunSession(sess); getGroupsManagerBl().checkGroupExists(sess, movingGroup); if(destinationGroup != null){ getGroupsManagerBl().checkGroupExists(sess, destinationGroup); if ((!AuthzResolver.isAuthorized(sess, Role.VOADMIN, movingGroup) && !AuthzResolver.isAuthorized(sess, Role.GROUPADMIN, movingGroup)) || (!AuthzResolver.isAuthorized(sess, Role.VOADMIN, destinationGroup) && !AuthzResolver.isAuthorized(sess, Role.GROUPADMIN, destinationGroup))) { throw new PrivilegeException(sess, "moveGroup"); } } else { if (!AuthzResolver.isAuthorized(sess, Role.VOADMIN, movingGroup)) { throw new PrivilegeException(sess, "moveGroup"); } } getGroupsManagerBl().moveGroup(sess, destinationGroup, movingGroup); }
Source:
public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } TimeAndDims that = (TimeAndDims) o; if (timestamp != that.timestamp) { return false; } for (int i = 0; i < dims.length; i++) { if (!Arrays.equals(dims[i], that.dims[i])) { return false; } } return true; }

Target:
public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } TimeAndDims that = (TimeAndDims) o; if (timestamp != that.timestamp) { return false; } if (dims.length != that.dims.length) { return false; } for (int i = 0; i < dims.length; i++) { if (!Arrays.equals(dims[i], that.dims[i])) { return false; } } return true; }
Source:
private StreamProcessor(int processorId, Config config, Map<String, MetricsReporter> customMetricsReporters, Object taskFactory) { this.processorId = processorId; Map<String, String> updatedConfigMap = new HashMap<>(); updatedConfigMap.putAll(config); updatedConfigMap.put(PROCESSOR_ID, String.valueOf(this.processorId)); Config updatedConfig = new MapConfig(updatedConfigMap); this.containerController = new SamzaContainerController( taskFactory, new TaskConfigJava(updatedConfig).getShutdownMs(), String.valueOf(processorId), customMetricsReporters); this.jobCoordinator = Util. <JobCoordinatorFactory>getObj( new JobCoordinatorConfig(updatedConfig) .getJobCoordinatorFactoryClassName()) .getJobCoordinator(processorId, updatedConfig, this.containerController); }

Target:
private StreamProcessor(int processorId, Config config, Map<String, MetricsReporter> customMetricsReporters, Object taskFactory) { this.processorId = processorId; Map<String, String> updatedConfigMap = new HashMap<>(); updatedConfigMap.putAll(config); updatedConfigMap.put(PROCESSOR_ID, String.valueOf(this.processorId)); Config updatedConfig = new MapConfig(updatedConfigMap); SamzaContainerController containerController = new SamzaContainerController( taskFactory, new TaskConfigJava(updatedConfig).getShutdownMs(), String.valueOf(processorId), customMetricsReporters); this.jobCoordinator = Util. <JobCoordinatorFactory>getObj( new JobCoordinatorConfig(updatedConfig) .getJobCoordinatorFactoryClassName()) .getJobCoordinator(processorId, updatedConfig, containerController); }
Source:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.login); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); toolbar.setTitle("Login"); setSupportActionBar(toolbar); connectionProgressDialog = new ProgressDialog(this); connectionProgressDialog.setMessage(getString(R.string.signing_in)); mUseZulipCheckbox = (CheckBox) findViewById(R.id.checkbox_usezulip); mServerEditText = (EditText) findViewById(R.id.server_url); mGoogleSignInButton = findViewById(R.id.google_sign_in_button); findViewById(R.id.google_sign_in_button).setOnClickListener(this); findViewById(R.id.zulip_login).setOnClickListener(this); mUseZulipCheckbox.setOnCheckedChangeListener(this); mUserName = (EditText) findViewById(R.id.username); mPassword = (EditText) findViewById(R.id.password); if (!BuildConfig.DEBUG) findViewById(R.id.local_server_button).setVisibility(View.GONE); }

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.login); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); toolbar.setTitle(R.string.title_login); setSupportActionBar(toolbar); connectionProgressDialog = new ProgressDialog(this); connectionProgressDialog.setMessage(getString(R.string.signing_in)); mUseZulipCheckbox = (CheckBox) findViewById(R.id.checkbox_usezulip); mServerEditText = (EditText) findViewById(R.id.server_url); mGoogleSignInButton = findViewById(R.id.google_sign_in_button); findViewById(R.id.google_sign_in_button).setOnClickListener(this); findViewById(R.id.zulip_login).setOnClickListener(this); mUseZulipCheckbox.setOnCheckedChangeListener(this); mUserName = (EditText) findViewById(R.id.username); mPassword = (EditText) findViewById(R.id.password); if (!BuildConfig.DEBUG) findViewById(R.id.local_server_button).setVisibility(View.GONE); }
Source:
public void setMenuItemActive(String nameToken) { $("a", menubar).toggleClass(widgetRes.header().menuActive(), false); $("a[href*=\"" + nameToken + "\"]", menubar).toggleClass(widgetRes.header().menuActive(), true); }

Target:
public void setMenuItemActive(String nameToken) { $("a", menubar).removeClass(widgetRes.header().menuActive()); $("a[href*=\"" + nameToken + "\"]", menubar).addClass(widgetRes.header().menuActive()); }
Source:
public List<String> getOid() { if (oid == null) { oid = new ArrayList<String>(); } return this.oid; }

Target:
public List<String> getOid() { return this.oid; }
Source:
private JobResult projectDoesNotExistError(final String jobId, final String projectName) { JobResult jobResult = new JobResult(); jobResult.setStatus(JobStatus.RESOURCE_NOT_EXIST); jobResult.setResult("Project [" + projectName + "] does not exist."); return jobResult; }

Target:
private JobResult projectDoesNotExistError(final String jobId, final String projectName) { JobResult jobResult = new JobResult(); jobResult.setJobId(jobId); jobResult.setStatus(JobStatus.RESOURCE_NOT_EXIST); jobResult.setResult("Project [" + projectName + "] does not exist."); return jobResult; }
Source:
public static HashMap<String, String> parseChecksummedMap(byte[] bytes) { int start = 0, end = bytes.length; while (start < end && bytes[start] <= ' ') { start++; } while (start < end && bytes[end - 1] <= ' ') { end--; } String s = new String(bytes, start, end - start, StandardCharsets.ISO_8859_1); HashMap<String, String> map = New.hashMap(); StringBuilder buff = new StringBuilder(); for (int i = 0, size = s.length(); i < size;) { int startKey = i; i = s.indexOf(':', i); if (i < 0) { throw DataUtils.newIllegalStateException( DataUtils.ERROR_FILE_CORRUPT, "Not a map: {0}", s); } if (i - startKey == 8 && s.regionMatches(startKey, "fletcher", 0, 8)) { DataUtils.parseMapValue(buff, s, i + 1, size); int check = (int) Long.parseLong(buff.toString(), 16); bytes = s.getBytes(StandardCharsets.ISO_8859_1); if (check == DataUtils.getFletcher32(bytes, 0, startKey - 1)) { return map; } return null; } String key = s.substring(startKey, i++); i = DataUtils.parseMapValue(buff, s, i, size); map.put(key, buff.toString()); buff.setLength(0); } return null; }

Target:
public static HashMap<String, String> parseChecksummedMap(byte[] bytes) { int start = 0, end = bytes.length; while (start < end && bytes[start] <= ' ') { start++; } while (start < end && bytes[end - 1] <= ' ') { end--; } String s = new String(bytes, start, end - start, StandardCharsets.ISO_8859_1); HashMap<String, String> map = New.hashMap(); StringBuilder buff = new StringBuilder(); for (int i = 0, size = s.length(); i < size;) { int startKey = i; i = s.indexOf(':', i); if (i < 0) { throw DataUtils.newIllegalStateException( DataUtils.ERROR_FILE_CORRUPT, "Not a map: {0}", s); } if (i - startKey == 8 && s.regionMatches(startKey, "fletcher", 0, 8)) { DataUtils.parseMapValue(buff, s, i + 1, size); int check = (int) Long.parseLong(buff.toString(), 16); if (check == DataUtils.getFletcher32(bytes, start, startKey - 1)) { return map; } return null; } String key = s.substring(startKey, i++); i = DataUtils.parseMapValue(buff, s, i, size); map.put(key, buff.toString()); buff.setLength(0); } return null; }
Source:
public Rule Operation() { return FirstOf( Sequence( Aggregate(), builder.setOperation( Operation.AGGREGATE_PIPELINE ) ), Sequence( Find(), builder.setOperation( Operation.FIND ) ), Sequence( FindOne(), builder.setOperation( Operation.FINDONE ) ), Sequence( FindAndModify(), builder.setOperation( Operation.FINDANDMODIFY ) ), Sequence( Insert(), builder.setOperation( Operation.INSERT ) ), Sequence( Remove(), builder.setOperation( Operation.REMOVE ) ), Sequence( Update(), builder.setOperation( Operation.UPDATE ) ), Sequence( Count(), builder.setOperation( Operation.COUNT ) ) ); }

Target:
public Rule Operation() { return FirstOf( Sequence( Find(), builder.setOperation( Operation.FIND ) ), Sequence( FindOne(), builder.setOperation( Operation.FINDONE ) ), Sequence( FindAndModify(), builder.setOperation( Operation.FINDANDMODIFY ) ), Sequence( Insert(), builder.setOperation( Operation.INSERT ) ), Sequence( Remove(), builder.setOperation( Operation.REMOVE ) ), Sequence( Update(), builder.setOperation( Operation.UPDATE ) ), Sequence( Count(), builder.setOperation( Operation.COUNT ) ), Sequence( Aggregate(), builder.setOperation( Operation.AGGREGATE_PIPELINE ) ) ); }
Source:
public Object createModule(String name) throws CheckstyleException { final String nameCheck = name + CHECK_SUFFIX; Object instance = createObject(name); if (instance == null) { instance = createObject(nameCheck); } if (instance == null) { instance = createObjectFromMap(name, NAME_TO_FULL_MODULE_NAME); } if (instance == null) { if (thirdPartyNameToFullModuleName == null) { thirdPartyNameToFullModuleName = generateThirdPartyNameToFullModuleName(moduleClassLoader); } instance = createObjectFromMap(name, thirdPartyNameToFullModuleName); } if (instance == null) { final String attemptedNames = joinPackageNamesWithClassName(name, packages) + STRING_SEPARATOR + nameCheck + STRING_SEPARATOR + joinPackageNamesWithClassName(nameCheck, packages); final LocalizedMessage exceptionMessage = new LocalizedMessage(0, Definitions.CHECKSTYLE_BUNDLE, UNABLE_TO_INSTANTIATE_EXCEPTION_MESSAGE, new String[] {name, attemptedNames}, null, getClass(), null); throw new CheckstyleException(exceptionMessage.getMessage()); } return instance; }

Target:
public Object createModule(String name) throws CheckstyleException { Object instance = null; if (!name.contains(PACKAGE_SEPARATOR)) { instance = createObjectFromMap(name, NAME_TO_FULL_MODULE_NAME); if (instance == null) { if (thirdPartyNameToFullModuleName == null) { thirdPartyNameToFullModuleName = generateThirdPartyNameToFullModuleName(moduleClassLoader); } instance = createObjectFromMap(name, thirdPartyNameToFullModuleName); } } if (instance == null) { instance = createObject(name); } final String nameCheck = name + CHECK_SUFFIX; if (instance == null) { instance = createObject(nameCheck); } if (instance == null) { final String attemptedNames = joinPackageNamesWithClassName(name, packages) + STRING_SEPARATOR + nameCheck + STRING_SEPARATOR + joinPackageNamesWithClassName(nameCheck, packages); final LocalizedMessage exceptionMessage = new LocalizedMessage(0, Definitions.CHECKSTYLE_BUNDLE, UNABLE_TO_INSTANTIATE_EXCEPTION_MESSAGE, new String[] {name, attemptedNames}, null, getClass(), null); throw new CheckstyleException(exceptionMessage.getMessage()); } return instance; }